home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / fc_11f.zip / FILECMDR.MA$ < prev    next >
Text File  |  1992-06-14  |  316KB  |  11,460 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                       TUTORIAL
  8.  
  9.  
  10.      Well, we admit it, we're still working on the documentation.
  11.      There are over 200 pages of it in this file.  We're working on
  12.      it every day.
  13.  
  14.      The information in this file is generally correct.  The function
  15.      reference section is complete.  The WIL language tutorial is
  16.      quite strong.  The information on how to build menus is correct
  17.      as far as it goes, but is a tad dated.  Some of it refers to
  18.      another one of our products with a similiar menu structure
  19.      (Command Post).  Where any serious problems occur, or where new
  20.      functions make a previously hard task simple, we've dropped in
  21.      a special comment in the form:
  22.  
  23.            #### Hi This is a special comment ####
  24.  
  25.      to keep you from going too far astray.
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                                      MENU FILES
  33.  
  34.  
  35.  
  36.  
  37.        What is a Menu File?
  38.        Menus are defined in standard ASCII text files (the kind created by
  39.        Notepad).  See your product documentation for the name of the default
  40.        menu file that it uses.
  41.  
  42.        Every menu file contains menu items which appear in the dropdown
  43.        menus, and may also contain top-level menu names which show up in a
  44.        main menu bar (refer to your product documentation for more
  45.        information).  For each menu item, you'll have one or more lines of
  46.        commands which the WIL Interpreter will execute when you choose that
  47.        item. Your menu will "feel" just like a regular Windows menu, but it
  48.        will manage things in a way tailored to suit your needs.
  49.  
  50.  
  51.  
  52.  
  53.        How to Create a Simple Menu
  54.        Using Windows Notepad, open the menu file, and scroll down to the end.
  55.        We're going to add a new menu specifically for desktop publishing
  56.        applications.
  57.  
  58.        First off, let's name our new menu. Starting in the first column (at
  59.        the far left), type:
  60.  
  61.         &DTP Apps
  62.  
  63.  
  64.        Because it begins in column 1, this entry defines a top-level menu
  65.        item.  Depending on the product you are using, it may either appear on
  66.        a menu bar or it may appear on the first-level dropdown menu.  The "&"
  67.        is optional ---
  68.                         it defines an Alt-key combination for the entry; Alt-
  69.        D in this example.  It will appear in the menu as "DTP Apps"..
  70.  
  71.        Since we intend to use PageMaker for our projects, we'll define a menu
  72.        item which lets us launch it. On the next line, beginning in column 2
  73.        (indented one space), type:
  74.  
  75.          &PageMaker 4.0
  76.  
  77.  
  78.        Below this menu item, we will enter the commands which let you launch
  79.        PageMaker.  These begin in column 5 or more (or you can tab once).
  80.        There are almost a hundred functions and commands in the Windows
  81.        Interface Language (WIL), but it takes only a few to get started.
  82.  
  83.        Well, what did we do to start PageMaker before we had Command Post?
  84.        We had to make sure we're in the proper drive, find the PageMaker
  85.        executable file, and doubleclick or run it.  We can put those steps in
  86.        our PageMaker menu with the DirChange and Run functions:
  87.  
  88.  
  89.  
  90.  
  91.  
  92.         &DTP Apps
  93.          &PageMaker 4.0
  94.            DirChange("C:\pm\docs")
  95.            Run("pm.exe","")
  96.  
  97.  
  98.        DirChange("C:\pm\docs") tells Command Post to change to the D: drive
  99.        and find the \PM\DOCS subdirectory. Run("pm.exe", "") tells Command
  100.        Post to launch the PM.EXE application, with no parameters passed to
  101.        it.
  102.  
  103.        Our simple menu is complete.  Now save the file and exit Notepad.
  104.        Then choose Reload Menu from Command Post's system menu box so our new
  105.        menu will take effect.
  106.  
  107.  
  108.  
  109.  
  110.        Enhancing Our Menu
  111.        Let's imagine that we have a special publishing project ("The Waldorf
  112.        Salad Cookbook" - should sell millions) that we've been working on
  113.        over a series of months. It has its own subdirectory, C:\PM\WALDORF,
  114.        and several PageMaker files - CHPTR1.PM4, CHPTR2.PM4, etc.  We would
  115.        like to have a separate menu item for each chapter so we can start
  116.        PageMaker with the chapter already loaded. We always use PageMaker at
  117.        full-screen, so we'd rather not have to press the Maximize box
  118.        whenever the program starts.  Also, we would like to launch the
  119.        CLIPBRD.EXE utility as an icon, since we check the clipboard often.
  120.        Let's create the first menu item , which will follow the generic
  121.        PageMaker 4.0 item we created above.
  122.  
  123.        Since this is a submenu item, it starts in column 2:
  124.  
  125.          PM-&Waldorf
  126.            DirChange ("C:\pm\waldorf")
  127.            RunZoom ("pm.exe", "chptr1.pm4")
  128.            RunIcon ("clipbrd.exe","")
  129.  
  130.  
  131.        Our menu item now does a lot of  work for us.  The RunZoom command has
  132.        a new parameter, "chptr1.pm4", which tells PageMaker which file to
  133.        load when it starts up.  The command RunIcon launches the Clipboard
  134.        viewer as an icon.
  135.  
  136.        We could define more menu items for the other chapters, and find
  137.        ourselves getting to work faster and easier than before.  Not to
  138.        mention helping other people work on the project without getting lost
  139.        in our particular directory structure.
  140.  
  141.  
  142.  
  143.  
  144.        An Enhancement for Safety
  145.        After spending 45 hours on CHPTR1.PM4, we start to worry a bit about
  146.        losing our work.  We decide to make a diskette backup of our chapter
  147.        at the beginning of each session.  We'll make it a part of the menu!
  148.        It now looks like this:
  149.  
  150.  
  151.  
  152.  
  153.  
  154.          PM-Waldorf Ch &1
  155.            DirChange ("C:\pm\waldorf")
  156.            ;Backup the current file first...
  157.            Pause ("Backup Chapter 1","Put Backup disk in Drive A:")
  158.            FileCopy ("Chptr1.pm4","a:chptr1.pm4",@FALSE)
  159.            RunZoom ("pm.exe", "chptr1.pm4")
  160.            RunIcon ("clipbrd.exe","")
  161.  
  162.  
  163.        Our menu changes to the proper directory, and now displays a dialog
  164.        box with the title "Backup Chapter 1", prompting the user to "Put
  165.        Backup disk in Drive A:".  The Pause function also creates OK and
  166.        Cancel buttons which let the user get out of the menu item (where did
  167.        I put that disk???) or continue.  If OK is clicked, FileCopy copies
  168.        the source file CHPTR1.PM4 to the destination A:CHPTR1.PM4.  The
  169.        @FALSE is a WIL constant which specifies that we do not want to prompt
  170.        the user if the file already exists in the target directory.
  171.  
  172.        It's a good idea to put comments in the file when you're trying to
  173.        accomplish something complex.  Comments start with a semicolon; the
  174.        rest of the line is ignored.
  175.  
  176.        This menu item is getting a bit complicated, but look at what we've
  177.        accomplished. You've automated the backup process, and made it hard to
  178.        forget. You don't have to memorize all those manual steps, and you
  179.        don't have to teach them to others. Menus make your life easier, and
  180.        in this case let you sleep easier too!
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.        Other Useful Functions
  190.  
  191.        CurrentFile ( )
  192.        Returns the name of the selected file (the one with the dotted
  193.        rectangle around it) from the Command Post window.  (See pg. 64)
  194.  
  195.        Example:
  196.         &Editing
  197.          Run &Notepad with selected file
  198.           Run ("Notepad", CurrentFile())
  199.  
  200.  
  201.        DirChange (pathname)
  202.        Changes the directory to the pathname specified.  (See pg. 75)
  203.  
  204.        Example:
  205.         &Miscellany
  206.          &Run some program not in path
  207.           DirChange ("c:\some\dir\not\in\path")
  208.           Run ("Obscure.exe","")
  209.  
  210.  
  211.  
  212.        Fun With Filenames
  213.        Sometimes you need to take a pathname and extract the drive letter,
  214.        directory path, or filename from it.  The WIL string functions help
  215.        you do this.
  216.  
  217.        Getting the drive letter is relatively easy.  Just make sure there's a
  218.        colon in the pathname in at least the second character position.  If
  219.        there is, take the character just before it:
  220.  
  221.           FullPath = AskLine ("", "Enter a full pathname", "")
  222.           ColonIsAt= StrIndex(FullPath, ":",1, @FWDSCAN)
  223.           ;if no colon or is first char, return "" drive letter:
  224.           LetterLen = Min (Max (ColonIsAt-1, 1), 0)
  225.           DriveLetter = StrSub(FullPath, ColonIsAt-1, 1)
  226.           Drop (ColonIsAt, LetterLen)
  227.  
  228.        The colon could come later than position #2 if the pathname includes a
  229.        network address before the drive letter.
  230.  
  231.        Getting the directory path is accomplished by finding the last
  232.        backslash character and taking everything before that point.  Note
  233.        when using StrIndex to search backwards from the end of a string, we
  234.        use a start position of 0:
  235.        #### Use FilePath() function instead here ####
  236.           Slash= StrIndex (FullPath, "\", 0,   @BACKSCAN)
  237.           DirPath = StrSub (FullPath, 1, Slash-1)
  238.           Drop (Slash)
  239.  
  240.        The filename is extracted in a similar manner:
  241.  
  242.  
  243.  
  244.        #### Use the FileRoot and FileExtension functions here instead ####
  245.  
  246.           Slash = StrIndex (FullPath, "\",          0,   @BACKSCAN)
  247.           FName = StrSub (FullPath, Slash+1,
  248.                                                     StrLen(FullPath)    -
  249.         Slash)
  250.           Drop (Slash)
  251.  
  252.        Once you have a filename you can extract its root.  First find the
  253.        dot.  If there isn't any, proceed as if it was at the end.  In either
  254.        case take the portion of the filename before the dot:
  255.  
  256.           DotIsAt = StrIndex (FileName,".",0,@FWDSCAN)
  257.           DotIsAt = DotIsAt*(DotIsAt!=0)
  258.                                      + (StrLen(FileName)+1)*(DotIsAt==0)
  259.           RootFileName=StrSub (FileName,1,DotIsAt-1)
  260.           Drop (DotIsAt)
  261.  
  262.        Getting the extension is easier:
  263.  
  264.           DotIsAt = StrIndex (FileName,".",0,@FWDSCAN)
  265.           Terminate (DotIsAt==0,"","File has no extension")
  266.           Ext= StrSub (FileName, DotIsAt+1, StrLen(FileName)-DotIsAt)
  267.           Drop (DotIsAt)
  268.  
  269.  
  270.  
  271.        Making a Free-Floating Menu
  272.        The Command Post directory window, coupled with the default menu in
  273.        CMDPOST.CPM, provides you with a more-useful file manager than is
  274.        provided by Windows version 2.x.  However there are times when all
  275.        you'd rather see is your custom menu bar without the directory
  276.        listing, perhaps nestled down at the lower-right hand corner of the
  277.        screen.
  278.  
  279.        This can be done rather easily in the initialization section of your
  280.        custom menu file with the WinPlace command:
  281.  
  282.           ThisWin = WinGetActive()
  283.           WinTitle (ThisWin, "Jenny's Favorites")
  284.           ;get these dimensions from WININFO.EXE:
  285.           WinPlace (710,872,1000,966,"Jenny's Favorites")
  286.  
  287.  
  288.  
  289.        When a Program is Already Running
  290.        When you launch a program from a menu and it's already running, some
  291.        times you'd rather just activate the window that's running instead of
  292.        invoking another instance of the same program:
  293.  
  294.         &Desktop
  295.          &Clock
  296.           ErrorMode (@OFF)           ; Turn Errors Off
  297.           Terminate (WinActivate("Clock"),"","")    ; Already running
  298.           ErrorMode (@CANCEL)             ; Re-enable default error mode
  299.           Run ("Clock.exe","")
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.        Working With Lists
  309.        When selecting a menu item to run an application program, you can
  310.        choose a file for the program to open from among all the appropriate
  311.        files in the current directory.  For example, assume we want to choose
  312.        from among the .WRI files, and then run Windows Write with the one we
  313.        highlighted.  If the user presses OK without selecting a file, we'll
  314.        still run Write, but we won't open a file:
  315.  
  316.           HTab = Num2Char (09)
  317.           WRIFiles = FileItemize("*.WRI")
  318.           TheFile = ItemSelect(".WRI file,
  319.                                 or just OK for new file",WRIFiles, HTab)
  320.           RunZoom ("Write.exe", TheFile)
  321.           Drop (WRIFiles, TheFile, HTab)
  322.  
  323.        We don't have to restrict ourselves to a single wildcard when we
  324.        itemize files.  And if we've set up an association between the file
  325.        extensions we're itemizing on and the programs that create them, we
  326.        don't have to restrict ourselves to a single program, either.
  327.  
  328.        For example, let's show a list of all our compressed files in the
  329.        current directory, allow the user to choose one, and run the
  330.        appropriate decompression program against it.  (This assumes we've set
  331.        up associations between these extensions and their respective
  332.        compression programs in WIN.INI's [Extensions] section):
  333.  
  334.         &Utilities
  335.          &Compress a file
  336.           Files = FileItemize ("*.ZIP *.LZH *.ARC *.PAK *.PKA")
  337.           TheFile = ItemSelect ("Choose a File", FileList, " ")
  338.           Run (TheFile,"")
  339.           Drop(FileList, TheFile)
  340.  
  341.        Of course, we don't have to itemize just by extension, either.  Any
  342.        kind of wildcard will do.  We can even itemize full pathnames.
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.                                      BATCH FILES
  350.  
  351.  
  352.  
  353.  
  354.        WIL Basics
  355.  
  356.  
  357.  
  358.        What is a Batch File?
  359.        A batch file, whether a DOS batch file or a WIL file, is simply a list
  360.        of commands for the computer to process.  Any task which will be run
  361.        more than once, or which requires entering many commands or even a
  362.        single complex command, is a candidate for a batch file.  For example,
  363.        suppose you regularly enter the following commands to start Windows:
  364.  
  365.        First:
  366.  
  367.         cd\windows
  368.  
  369.        then:
  370.  
  371.         win
  372.  
  373.        and then:
  374.  
  375.         cd\
  376.  
  377.        Here, you are changing to the Windows directory, running Windows, and
  378.        then returning to the root directory.  Instead of having to type these
  379.        three commands every time you run Windows, you can create a DOS batch
  380.        file, called WI.BAT, which contains those exact same commands:
  381.  
  382.         cd\windows
  383.         win
  384.         cd\
  385.  
  386.        Now, to start Windows, you merely need to type the single command WI,
  387.        which runs the WI.BAT batch file, which executes your three commands.
  388.  
  389.        WIL files work basically the same way.
  390.  
  391.  
  392.  
  393.  
  394.        Our First WIL File
  395.        Our first WIL file will simply run our favorite Windows application:
  396.        Solitaire.  First, start up Notepad, or any other editor which is
  397.        capable of saving text in pure ASCII format (may we suggest WinEdit,
  398.        from Wilson WindowWare).  Enter the following line of text:
  399.  
  400.         Run("sol.exe", "")
  401.  
  402.        Save the file with the name SOLITARE.WBT.  Now, run SOLITARE.WBT by
  403.        starting or switching to the File Manager (or MS-DOS Executive), and
  404.        either moving the cursor to the file name and pressing Enter, or
  405.  
  406.  
  407.  
  408.  
  409.  
  410.        double-clicking on the file name with your mouse.  Presto!  It's
  411.        Solitaire.
  412.  
  413.        Okay, that wasn't really so impressive.  But it did serve to
  414.        illustrate several important WIL points.  They are:
  415.  
  416.        1.   WIL files must be edited and saved in ASCII format.
  417.  
  418.        2.   WIL files should be given a WBT extension.  When WIL is first
  419.          installed, it creates an entry in your WIN.INI file which causes
  420.          files with a WBT extension to be associated with WIL.  As long as
  421.          WIL.EXE is located in your DOS path, you can place WBT files in any
  422.          directory and run them by simply selecting them, as we did above.
  423.  
  424.        3.   After you have created a WBT file, you run it by moving your
  425.          cursor to it and pressing Enter, or double-clicking on it with your
  426.          mouse (you can also add a WBT file to a program group and run it
  427.          using the Program Manager; see your Windows manual for further
  428.          information).  Whatever method you use, we'll use the term Run to
  429.          refer to selecting and running the file.
  430.  
  431.  
  432.  
  433.  
  434.        Functions and Parameters
  435.        Now, let's look more closely at the line we entered:
  436.  
  437.         Run("sol.exe", "")
  438.  
  439.        The first part, Run, is a WIL function.  As you might have guessed,
  440.        its purpose is to run a Windows program.  There are over a hundred
  441.        different functions and commands in WIL, and each has a certain syntax
  442.        which must be used.  The correct syntax for all WIL functions may be
  443.        found in the WIL Function Reference (pg. 55).  The entry for Run
  444.        starts off as follows:
  445.  
  446.  
  447.        Syntax:
  448.         Run (program-name, parameters)
  449.  
  450.        Parameters:
  451.         "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT file,
  452.                      or a data file.
  453.         "parameters" =     optional parameters as required by the
  454.                      application.
  455.  
  456.  
  457.        Like all WIL functions, Run is followed by a number of parameters,
  458.        enclosed in parentheses.  Parameters are simply additional information
  459.        which are provided when a particular function is used; they may be
  460.        either required or optional.  Optional parameters are indicated by
  461.        being enclosed in square brackets.  In this case, Run has two required
  462.        parameters: the name of the program to run, and the parameters to be
  463.        passed to the program.
  464.  
  465.        WIL functions use several types of parameters.  Multiple parameters
  466.        are separated by commas.  In the example
  467.  
  468.  
  469.  
  470.  
  471.  
  472.         Run("sol.exe", "")
  473.  
  474.        "sol.exe" and "" are both string constants.  String constants can be
  475.        identified by the quote marks which delimit (surround) them.  You may
  476.        use either double ("), single forward (') or single back (`) quote
  477.        marks as string delimiters; the examples in this manual will use
  478.        double quotes.
  479.  
  480.        You may have noticed how we said earlier that the two parameters for
  481.        the Run function are required, and yet the entry for Run in the WIL
  482.        Function Reference describes the second parameter -- "parameters" --
  483.        as being optional.  Which is correct?  Well, from a language
  484.        standpoint, the second parameter is required.  That is, if you omit
  485.        it, you will get a syntax error, and your batch file will not run
  486.        properly.  However, the program that you are running may not need any
  487.        parameters.  Solitaire, for example, does not take any parameters.
  488.        The way we handle this in our batch file is to specify a null string -
  489.        - two quote marks with nothing in between -- as the second parameter,
  490.        as we have done in our example above.
  491.  
  492.        To illustrate this further, let's create a WIL file called EDIT.WBT,
  493.        containing the following line:
  494.  
  495.         Run("notepad.exe", "")
  496.  
  497.        This is just like our previous file, with only the name of the program
  498.        having been changed.  Save the file, and run it.  You should now be in
  499.        Notepad.  Now edit the EDIT.WBT file as follows:
  500.  
  501.         Run("notepad.exe", "solitare.wbt")
  502.  
  503.        Save the file, exit Notepad, and run EDIT.WBT again.  You should now
  504.        be in Notepad, with SOLITARE.WBT loaded.  As we've just demonstrated,
  505.        Notepad is an example of a program which can be run with or without a
  506.        file name parameter passed to it by WIL.
  507.  
  508.        Before you leave Notepad, modify EDIT.WBT as follows:
  509.  
  510.         ; This is an example of the Run function in WIL
  511.         Run("notepad.exe", "solitare.wbt")
  512.  
  513.        The semicolon at the beginning of the first line signifies a comment,
  514.        and causes that line to be ignored.  You can place comment lines,
  515.        and/or blank lines anywhere in your WIL files.  In addition, you can
  516.        place a comment on the same line as a function by preceding the
  517.        comment with a semicolon.  For example:
  518.  
  519.         Run("sol.exe", "")   ; this is a very useful function
  520.  
  521.        Everything to the right of a semicolon is ignored.  However, if a
  522.        semicolon appears in a string delimited by quotes, it is treated as
  523.        part of the string.
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.        Displaying Text
  533.        Now, let's modify our SOLITARE.WBT file as follows.  You might as well
  534.        use the EDIT.WBT batch file you created earlier to start up Notepad:
  535.  
  536.         ; solitare.wbt
  537.         Display(5, "Good Luck!", "Remember ... it's only a game.")
  538.         Run("sol.exe", "")
  539.  
  540.        And run it.  Notice the message box which pops up on the screen with
  541.        words of encouragement:
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.        That's done by the Display function in the second line above.  Here's
  552.        the reference for Display:
  553.  
  554.  
  555.        Syntax:
  556.         Display (seconds, title, text)
  557.  
  558.        Parameters:
  559.         seconds =    integer seconds to display the message (1-15).
  560.         "title" =    Title of the window to be displayed.
  561.         "text" =     Text of the window to be displayed.
  562.  
  563.  
  564.        Note that the Display function has three parameters.  The first
  565.        parameter -- in our example, 5 -- is the number of seconds which the
  566.        display box will remain on the screen (you can make the box disappear
  567.        before then by pressing any key or mouse button).  This is a numeric
  568.        constant, and -- unlike string constants -- it does not need to be
  569.        enclosed in quotes (although it can be, if you wish, as WIL will
  570.        automatically try to convert string variables to numeric variables
  571.        when necessary, and vice versa).  The second parameter is the title of
  572.        the message box, and the third parameter is the actual text displayed
  573.        in the box.  Now, exit Solitaire (if you haven't already done so), and
  574.        edit SOLITARE.WBT by placing a semicolon at the beginning of the line
  575.        with the Run function.  This is a handy way to disable, or "comment
  576.        out," lines in your WIL files when you want to modify and test only
  577.        certain segments.  Your SOLITARE.WBT file should look like this:
  578.  
  579.         ; solitare.wbt
  580.         Display(5, "Good Luck!", "Remember ... it's only a game.")
  581.         ; Run("sol.exe", "")
  582.  
  583.        Now, experiment with modifying the parameters in the Display function.
  584.        Try adjusting the value of the first parameter.  If you look up
  585.        Display in the WIL reference section, you will see that the acceptable
  586.  
  587.  
  588.  
  589.  
  590.  
  591.        values for this parameter are 1-15.  If you use a value outside this
  592.        range, WIL will adjust it to "make it fit"; that is, it will treat
  593.        numbers less than 1 as if they were 1, and numbers greater than 15 as
  594.        15.  Experiment.  Also, try using a non-integer value, such as 2.5,
  595.        and see what happens.  Play around with the text in the two string
  596.        parameters; try making one, or both, null strings ("").
  597.  
  598.  
  599.  
  600.  
  601.        Getting Input
  602.        Now, let's look at ways of getting input from a user and making
  603.        decisions based on that input.  The most basic form of input is a
  604.        simple Yes/No response, and, indeed, there is a WIL function called
  605.        AskYesNo:
  606.  
  607.  
  608.        Syntax:
  609.         AskYesNo (title, question)
  610.  
  611.        Parameters
  612.         "title" =    title of the question box.
  613.         "question" = question to be put to the user.
  614.  
  615.        Returns:
  616.         (integer)    @YES or @NO, depending on the button pressed.
  617.  
  618.  
  619.        You should be familiar with the standard syntax format by now; it
  620.        shows us that AskYesNo has two required parameters.  The Parameters
  621.        section tells us that these parameters both take strings (indicated by
  622.        the quote marks), and tells us what each of the parameters means.
  623.  
  624.        You will notice that there is also a new section here, titled Returns.
  625.        This section shows you the possible values that may be returned by
  626.        this function.  All functions return values.  We weren't concerned
  627.        with the values returned by the Run and Display functions.  But with
  628.        AskYesNo, the returned value is very important, because we will need
  629.        that information to decide how to proceed.  We see that AskYesNo
  630.        returns an integer value.  An integer is a whole (non-fractional)
  631.        number, such as 0, 1, or 2 (the number 1.5 is not an integer).  We
  632.        also see that the integer value returned by AskYesNo is either @YES or
  633.        @NO.  @YES and @NO are predefined constants in WIL.  All predefined
  634.        constants begin with an @ symbol, and we will distinguish them further
  635.        by typing them in all caps.  You will find a list of all predefined
  636.        constants in Appendix A (pg. 185).  Even though the words Yes and No
  637.        are strings, it is important to remember that the predefined constants
  638.        @YES and @NO are not string variables (actually, @YES is equal to 1,
  639.        and @NO is equal to 0.  Don't worry if this is confusing; you don't
  640.        need to remember it).
  641.  
  642.        Now, let's modify our SOLITARE.WBT file as follows:
  643.  
  644.         AskYesNo("Really?", "Play Solitaire now?")
  645.         Run("sol.exe", "")
  646.  
  647.  
  648.  
  649.  
  650.  
  651.        and run it.  You should have gotten a nice dialog box which asked if
  652.        you wanted to play Solitaire:
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.        but no matter what you answered, it started Solitaire anyway.  This is
  667.        not very useful.  We need a way to use the Yes/No response to
  668.        determine further processing.  First, we need to explore the concept
  669.        and use of variables.
  670.  
  671.  
  672.  
  673.  
  674.        Using Variables
  675.        A variable is simply a placeholder for a value.  The value that the
  676.        variable stands for can be either a text string (string variable) or a
  677.        number (numeric variable).  You may remember from Algebra 101 that if
  678.        X=3, then X+X=6.  X is simply a numeric variable, which stands here
  679.        for the number 3.  If we change the value of X to 4 (X=4), then the
  680.        expression X+X is now equal to 8.
  681.  
  682.        Okay.  We know that the AskYesNo function returns a value of either
  683.        @YES or @NO.  What we need to do is create a variable to store the
  684.        value that AskYesNo returns, so that we can use it later on in our
  685.        batch file.  First, we need to give this variable a name.  In WIL,
  686.        variable names must begin with a letter, may contain any combination
  687.        of letters or numbers, and may be from 1 to 30 characters long.  So,
  688.        let's use a variable called response (we will distinguish variable
  689.        names in this text by typing them in all lowercase letters; we will
  690.        type function and command names starting with a capital letter.
  691.        However, in WIL, the case is not significant, so you can use all
  692.        lowercase, or all uppercase, or whatever combination you prefer).  We
  693.        assign the value returned by AskYesNo to the variable response, as
  694.        follows:
  695.  
  696.         response = AskYesNo("Really?", "Play Solitaire now?")
  697.  
  698.        Notice the syntax.  The way that WIL processes this line is to first
  699.        evaluate the result of the AskYesNo function.  The function returns a
  700.        value of either @YES or @NO.  Then, WIL assigns this returned value to
  701.        response.  Therefore, response is now equal to either @YES or @NO,
  702.        depending on what the user enters.
  703.  
  704.        Now, we need a way to make a decision based upon this variable.
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.        Making Decisions
  714.        WIL provides a way to conditionally execute a statement, and that is
  715.        by using the If ... Then command.  Actually, there are two separate
  716.        parts to this construct: If and Then.  The format is:
  717.  
  718.           If condition Then statement
  719.  
  720.        (We refer to If ... Then as a command, rather than a function, because
  721.        functions are followed by parameters in parentheses, while commands
  722.        are not.  Commands are used for system control.)
  723.  
  724.        The use of If ... Then can easily be illustrated by going back to our
  725.        SOLITARE.WBT file, and making these modifications:
  726.  
  727.         response = AskYesNo("Really?", "Play Solitaire now?")
  728.         If response == @YES Then Run("sol.exe", "")
  729.  
  730.        In this example, we are using If ... Then to test whether the value of
  731.        the variable response is @YES.  If it is @YES, we start Solitaire.  If
  732.        it isn't @YES, we don't.  The rule is: if the condition following the
  733.        If keyword is true, then the statement following the Then keyword is
  734.        performed.  If the condition following the If keyword is false, then
  735.        anything following the Then keyword is ignored.
  736.  
  737.        There is something extremely important that you should note about the
  738.        syntax of the If ... Then command: the double equal signs (==).  In
  739.        WIL, a single equal sign (=) is an assignment operator -- it assigns
  740.        the value on the right of the equal sign to the variable on the left
  741.        of the equal sign.  As in:
  742.  
  743.         response = AskYesNo("Really?", "Play Solitaire now?")
  744.  
  745.        This is saying, in English: "Assign the value returned by the AskYesNo
  746.        function to the variable named response."  But in the statement:
  747.  
  748.         If response == @YES Then Run("sol.exe", "")
  749.  
  750.        we do not want to assign a new value to response, we merely want to
  751.        test whether it is equal to @YES.  Therefore, we use the double equal
  752.        signs (==), which is the equality operator in WIL.  The statement
  753.        above is saying, in English: "If the value of the variable named
  754.        response is equal to @YES, then run the program SOL.EXE."  If you used
  755.        a single equal sign (=) here by mistake, you would get an error
  756.        message:
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.        Which is WIL's way of telling you to re-check your syntax.
  765.  
  766.        If you've become confused, just remember that a single equal sign (=)
  767.        is an assignment operator, used to assign a value to a variable.
  768.        Double equal signs (==) are an equality operator, used to test whether
  769.        the values on both sides of the operator are the same.  If you have a
  770.        problem with one of your WIL files, make sure to check whether you've
  771.        used one of these symbols incorrectly.  It's a very common mistake,
  772.        which is why we emphasize it so strongly!
  773.  
  774.        We've seen what happens when the condition following the Then keyword
  775.        is true.  But what happens when it is false?  Remember we said that
  776.        when the If condition is false, the Then statement is ignored.  There
  777.        will be times, however when we want to perform an alternate action in
  778.        this circumstance.  For example, suppose we want to display a message
  779.        if the user decides that he or she doesn't want to play Solitaire.  We
  780.        could write:
  781.  
  782.         response = AskYesNo("Really?", "Play Solitaire now?")
  783.         If response == @YES Then Run("sol.exe", "")
  784.         If response == @NO Then Display(5, "", "Game canceled")
  785.  
  786.        In this case there are two If statements being evaluated, with one and
  787.        only one of them possibly being true (unless the user selects Cancel,
  788.        which would abort the batch file entirely).  However, this is
  789.        inefficient from a processing standpoint.  Furthermore, what would
  790.        happen if you had several functions you wanted to perform if the user
  791.        answered Yes?  You would end up with something unwieldy:
  792.  
  793.         response = AskYesNo("Really?", "Play Solitaire now?")
  794.         If response == @YES Then Display(5, "", "On your mark ...")
  795.         If response == @YES Then Display(5, "", "Get set ...")
  796.         If response == @YES Then Display(5, "", "Go!")
  797.         If response == @YES Then Run("sol.exe", "")
  798.  
  799.        Clearly, there must be a better way of handling this.
  800.  
  801.  
  802.  
  803.  
  804.        Branching
  805.        Enter the Goto command.  Goto, in combination with If ... Then, gives
  806.        you the ability to redirect the flow of control in your WIL files.
  807.        Goto does exactly what it says -- it causes the flow of control to go
  808.        to another point in the batch file.  You must specify where you want
  809.        the flow of control to be transferred, and you must mark this point
  810.        with a label.  A label is simply a destination address, or marker.
  811.        The form of the Goto command is:
  812.  
  813.           Goto label
  814.  
  815.        where label is an identifier that you specify.  The same rules apply
  816.        to label names as to variable names (the first character must be a
  817.        letter, the label name may consist of any combination of letters and
  818.        numbers, and the label name may be from 1 to 30 characters long).  In
  819.  
  820.  
  821.  
  822.  
  823.  
  824.        addition, the label is preceded by a colon (:) at the point where it
  825.        is being used as a destination address.  Here's an example:
  826.  
  827.         response = AskYesNo("Really?", "Play Solitaire now?")
  828.         If response == @NO Then Goto quit
  829.         Display(5, "", "On your mark ...")
  830.         Display(5, "", "Get set ...")
  831.         Display(5, "", "Go!")
  832.         Run("sol.exe", "")
  833.         :quit
  834.  
  835.        If the If condition is true (that is, if the user answers No), then
  836.        the Goto statement is performed.  The Goto statement is saying, in
  837.        English "go to the line marked :quit, and continue processing from
  838.        there."  Notice how the label quit is preceded by a colon on the last
  839.        line, but not on the line where it follows the Goto keyword.  This is
  840.        important.  Although you can have multiple lines in your batch file
  841.        which say Goto quit, you can have only one line marked :quit (just
  842.        like you can have several people going to your house, but can have
  843.        only one house with a particular address).  Of course, you can use
  844.        many different labels in a batch file, just as you can use many
  845.        different variables, as long as each has a unique name.  For example:
  846.  
  847.         response = AskYesNo("Really?", "Play Solitaire now?")
  848.         If response == @NO Then Goto quit
  849.         Display(5, "", "On your mark ...")
  850.         Display(5, "", "Get set ...")
  851.         Display(5, "", "Go!")
  852.         Run("sol.exe", "")
  853.         Goto done
  854.         :quit
  855.         Display(5, "", "Game canceled")
  856.         :done
  857.  
  858.        This is a little more complicated.  It uses two labels, quit and done.
  859.        If the user answers No, then the If condition is true, control passes
  860.        to the line marked :quit, and a message is displayed.  If, on the
  861.        other hand, the user answers Yes, then the If condition is false, and
  862.        the Goto quit line is ignored.  Instead, the next four lines are
  863.        processed, and then the Goto done statement is performed.  The purpose
  864.        of this line is to bypass the Display line which follows, by
  865.        transferring control to the end of the batch file.  There is another
  866.        way to keep your batch file processing from "falling through" to
  867.        unwanted lines at the end of a program, and that is with the Exit
  868.        command.  Exit causes a batch file to end immediately.  So, for
  869.        example, we could rewrite the above batch file as follows:
  870.  
  871.         response = AskYesNo("Really?", "Play Solitaire now?")
  872.         If response == @NO Then Goto quit
  873.         Display(5, "", "On your mark ...")
  874.         Display(5, "", "Get set ...")
  875.         Display(5, "", "Go!")
  876.         Run("sol.exe", "")
  877.         Exit
  878.         :quit
  879.         Display(5, "", "Game canceled")
  880.  
  881.  
  882.  
  883.  
  884.  
  885.        Since the Run function is the last thing we want to do if the user
  886.        answers Yes, the Exit command simply ends the program at that point.
  887.        Note that we could put an Exit command at the end of the program as
  888.        well, but it isn't necessary.  An Exit is implied at the end of a WIL
  889.        program.
  890.  
  891.  
  892.  
  893.        This concludes the first part of our tutorial.  You now have the
  894.        building blocks you need to create useful WIL files.  In the second
  895.        part, which follows, we will look in more detail at some of the WIL
  896.        functions which are available for your use.
  897.  
  898.  
  899.  
  900.  
  901.        Exploring WIL
  902.        What follows is just a sample of the many functions and commands
  903.        available in WIL.  These should be sufficient to begin creating
  904.        versatile and powerful batch files.  For complete information on these
  905.        and all WIL functions and commands, refer to the WIL Function
  906.        Reference (pg. 55).
  907.  
  908.  
  909.  
  910.  
  911.        Running Programs
  912.        There are three functions which you can use to start an application,
  913.        each of which shares a common syntax:
  914.  
  915.  
  916.        Run (program-name, parameters)
  917.        We've already seen the Run function.  This function starts a program
  918.        in a "normal" window.  Windows decides where to place the
  919.        application's  window on the screen.
  920.  
  921.        Example:
  922.         Run("notepad.exe", "myfile.txt")
  923.  
  924.        If the program has an EXE extension, its extension may be omitted:
  925.  
  926.         Run("notepad", "myfile.txt")
  927.  
  928.        Also, you can "run" data files if they have an extension in WIN.INI
  929.        which is associated with an executable program.  So, if TXT files are
  930.        associated with Notepad:
  931.  
  932.         Run("myfile.txt", "")
  933.  
  934.        would start Notepad, using the file MYFILE.TXT.
  935.  
  936.        When you specify a file to run, WIL looks first in the current
  937.        directory, and then in the directories on your DOS path.  If the file
  938.        is not found, WIL will return an error.  You can also specify a full
  939.        path name for WIL to use, as in:
  940.  
  941.         Run("c:\windows\apps\winedit.exe", "")
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.        RunZoom (program-name, parameters)
  949.        RunZoom is like Run, but starts a program as a full-screen window.
  950.  
  951.        Example:
  952.         RunZoom("excel", "bigsheet.xls")
  953.  
  954.        RunIcon (program-name, parameters)
  955.        RunIcon starts a program as an icon at the bottom of the screen.
  956.  
  957.        Example:
  958.         RunIcon("clock", "")
  959.  
  960.  
  961.  
  962.        Display and Input
  963.        Here we have functions which display information to the user and
  964.        prompt the user for information, plus a couple of relevant system
  965.        functions.
  966.  
  967.  
  968.        Display (seconds, title, text)
  969.        Displays a message to the user for a specified period of time.  The
  970.        message will disappear after the time expires, or after any keypress
  971.        or mouse click.
  972.  
  973.        Example:
  974.         Display(2, "", "Loading Solitaire now")
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.        Message (title, text)
  984.        This command displays a message box with a title and text you specify,
  985.        which will remain on the screen until the user presses the OK button.
  986.  
  987.        Example:
  988.         Message("Sorry", "That file cannot be found")
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.        Pause (title, text)
  1000.        This command is similar to Message, except an exclamation-point icon
  1001.        appears in the message box, and the user can press OK or Cancel.  If
  1002.        the user presses Cancel, the batch file exits.
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.        Example:
  1009.         Pause("Delete Backups", "Last chance to stop!")
  1010.         ; if batch file gets this far, the user pressed OK
  1011.         FileDelete("*.bak")
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.        AskYesNo (title, question)
  1023.        Displays a dialog box with a given title, which presents the user with
  1024.        three buttons: Yes, No, and Cancel.  If the user selects the Cancel
  1025.        button, the batch file is terminated.
  1026.  
  1027.        Example:
  1028.         response = AskYesNo("End Session", "Really quit Windows?")
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.        AskLine (title, prompt, default)
  1040.        Displays a dialog box with a given title, which prompts the user for a
  1041.        line of input.  Returns the default if the user just presses the OK
  1042.        button.
  1043.  
  1044.        Example:
  1045.         yourfile = AskLine("Edit File", "Filename:", "newfile.txt")
  1046.         Run("notepad", yourfile)
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.        If you specify a default value (as we have with NEWFILE.TXT), it will
  1062.        appear in the response box, and will be replaced with whatever the
  1063.        user types.  If the user doesn't type anything, the default is used.
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.        Beep
  1071.        Beeps once.
  1072.  
  1073.         Beep
  1074.  
  1075.        And if one beep isn't enough for you:
  1076.  
  1077.         Beep
  1078.         Beep
  1079.         Beep
  1080.  
  1081.        Delay (seconds)
  1082.        Pauses batch file execution.
  1083.  
  1084.        The Delay function lets you suspend batch file processing for 1 to 15
  1085.        seconds.  You can use multiple occurrences for a longer delay:
  1086.  
  1087.         Delay(15)
  1088.         Delay(15)
  1089.  
  1090.        Will insert a 30-second pause.
  1091.  
  1092.  
  1093.  
  1094.  
  1095.        Manipulating Windows
  1096.        There are a large number of functions which allow you to manage the
  1097.        windows on your desktop.  Here are some of them:
  1098.  
  1099.  
  1100.        WinZoom (partial-windowname)
  1101.        Maximizes an application window to full-screen.
  1102.  
  1103.  
  1104.        WinIconize (partial-windowname)
  1105.        Turns an application window into an icon.
  1106.  
  1107.  
  1108.        WinShow (partial-windowname)
  1109.        Shows a window in its "normal" state.
  1110.  
  1111.  
  1112.  
  1113.        These three functions are used to modify the size of an already-
  1114.        running window.  WinZoom is the equivalent of selecting Maximize from
  1115.        a window's control menu, WinIconize is like selecting Minimize, and
  1116.        WinShow is like selecting Restore.
  1117.  
  1118.        The window on which you are performing any of these functions does not
  1119.        have to be the active window.  If the specified window is in the
  1120.        background, and a WinZoom or WinShow function causes the size of the
  1121.        window to change, then the window will be brought to the foreground.
  1122.        The WinZoom function has no effect on a window which is already
  1123.        maximized; likewise, WinShow has no effect on a window which is
  1124.        already "normal."
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.        Each of these functions accepts a partial windowname as a parameter.
  1131.        The windowname is the name which appears in the title bar at the top
  1132.        of the window.  You can specify the full name if you wish, but it may
  1133.        often be advantageous not to have to do so.  For example, if you are
  1134.        editing the file SOLITARE.WBT in a Notepad window, the windowname will
  1135.        be Notepad - SOLITARE.WBT:
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.        You probably don't want to have to hard-code this entire name into
  1159.        your batch file as:
  1160.  
  1161.         WinZoom("Notepad - SOLITARE.WBT")
  1162.  
  1163.        Instead, you can specify the partial windowname "Notepad":
  1164.  
  1165.         WinZoom("Notepad")
  1166.  
  1167.        If you have more than one Notepad window open, WIL will use the one
  1168.        which was most recently used or started.
  1169.  
  1170.        Note that WIL matches the partial windowname beginning with the first
  1171.        character, so that while
  1172.  
  1173.         WinZoom("Note")
  1174.  
  1175.        would be correct,
  1176.  
  1177.         WinZoom("pad")
  1178.  
  1179.        would not result in a match.
  1180.  
  1181.        Also, the case (upper or lower) of the title is significant, so
  1182.  
  1183.         WinZoom("notepad")
  1184.  
  1185.        would not work either.
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.        WinActivate (partial-windowname)
  1193.        Makes an application window the active window.
  1194.  
  1195.        This function makes a currently-open window the active window.  If the
  1196.        specified window is an icon, it will be restored to normal size;
  1197.        otherwise, its size will not be changed.
  1198.  
  1199.  
  1200.        WinClose (partial-windowname)
  1201.        Closes an application window.
  1202.  
  1203.        This is like selecting Close from an application's control menu.  You
  1204.        will still receive any closing message(s) that the application would
  1205.        normally give you, such as an "unsaved-file" dialog box.
  1206.  
  1207.  
  1208.        WinCloseNot (partial-windowname
  1209.             [, partial-windowname]...)
  1210.        Closes all application windows except those specified.
  1211.  
  1212.        This function lets you close all windows except the one(s) you want to
  1213.        remain open.  For example:
  1214.  
  1215.         WinCloseNot("Program Man")
  1216.  
  1217.        would leave only the Program Manager open, and:
  1218.  
  1219.         WinCloseNot("Program Man", "Solit")
  1220.  
  1221.        would leave the Program Manager and Solitaire windows open.
  1222.  
  1223.  
  1224.        WinWaitClose (partial-windowname)
  1225.        Waits until an application window is closed.
  1226.  
  1227.        This function causes your WIL file to pause until you have manually
  1228.        closed a specified window.  This is a convenient way to get WIL to
  1229.        open several windows sequentially, thereby not having unnecessary
  1230.        windows all over your desktop.  For example:
  1231.  
  1232.         RunZoom("invoices.xls", "")       ;balance the books
  1233.         WinWaitClose("Microsoft Ex")      ;wait till Excel closed
  1234.         RunZoom("sol", "")                     ;you deserve a break
  1235.         WinWaitClose("Solitaire")              ;wait until Solit closed
  1236.         Run("winword", "agenda.doc")      ;more paperwork
  1237.         WinWaitClose("Microsoft Wor")          ;wait until W4W closed
  1238.         Run("clock","")                        ;lunchtime yet?
  1239.  
  1240.        During the time that the batch file is suspended, the WIL icon will
  1241.        remain at the bottom of your screen.  You can cancel the batch file at
  1242.        any time by selecting Terminate from the icon's control menu.
  1243.  
  1244.  
  1245.        WinExist (partial-windowname)
  1246.        Tells if a window exists.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.        This function returns @TRUE or @FALSE, depending on whether a matching
  1253.        window can be found.  This provides a way of insuring that only one
  1254.        copy of a given window will be open at a time.
  1255.  
  1256.        If you've been following this tutorial faithfully from the beginning,
  1257.        you probably have several copies of Solitaire running at the moment.
  1258.        (You can check by pressing Ctrl-Esc and bringing up the Task Manager.
  1259.        You say you've got five Solitaire windows open?  Okay, close them
  1260.        all.)  Now, let's modify our SOLITARE.WBT file.  First, trim out the
  1261.        excess lines so that it looks like this:
  1262.  
  1263.         Run("sol.exe", "")
  1264.  
  1265.        Now, let's use the WinExist function to make sure that WIL only starts
  1266.        Solitaire if it isn't already running:
  1267.  
  1268.         If WinExist("Solitaire") == @FALSE Then Run("sol.exe", "")
  1269.  
  1270.        And this should work fine.  Run SOLITARE.WBT twice now, and see what
  1271.        happens.  The first time you run it, it should start Solitaire; the
  1272.        second (and subsequent) time, it should not do anything.
  1273.  
  1274.        However, it's quite likely that you want the batch file to do
  1275.        something if Solitaire is already running -- namely, bring the
  1276.        Solitaire window to the foreground.  This can be accomplished by using
  1277.        the WinActivate function, along with a couple of Goto statements:
  1278.  
  1279.         If WinExist("Solitaire") == @FALSE Then Goto open
  1280.         WinActivate("Solitaire")
  1281.         Goto loaded
  1282.         :open
  1283.         Run("sol.exe", "")
  1284.         :loaded
  1285.  
  1286.        Note that we can change this to have WinExist check for a True value
  1287.        instead, by modifying the structure of the batch file:
  1288.  
  1289.         If WinExist("Solitaire") == @TRUE Then Goto activate
  1290.         Run("sol.exe", "")
  1291.         Goto loaded
  1292.         :activate
  1293.         WinActivate("Solitaire")
  1294.         :loaded
  1295.  
  1296.        Either format is perfectly correct, and the choice of which to use is
  1297.        merely a matter of personal style.  The result is exactly the same.
  1298.  
  1299.  
  1300.        EndSession ( )
  1301.        Ends the current Windows session.
  1302.  
  1303.        This does exactly what it says.  It will not ask any questions
  1304.        (although you will receive any closing messages that your currently-
  1305.        open windows would normally display), so you may want to build in a
  1306.        little safety net:
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.         sure = AskYesNo("End Session", "Really quit Windows?")
  1313.         If sure == @YES Then EndSession()
  1314.  
  1315.        EndSession is an example of a WIL function which does not take any
  1316.        parameters, as indicated by the empty parentheses which follow it.
  1317.        The parentheses are still required, though.
  1318.  
  1319.  
  1320.  
  1321.  
  1322.        Files and Directories
  1323.  
  1324.        DirChange (pathname)
  1325.        Changes the directory to the pathname specified.
  1326.  
  1327.        Use this function when you want to run a program which must be started
  1328.        from its own directory.  "Pathname" may optionally include a drive
  1329.        letter.
  1330.  
  1331.        Example:
  1332.         DirChange("c:\windows\winword")
  1333.         Run("winword.exe", "")
  1334.  
  1335.        DirGet ( )
  1336.        Gets the current working directory.
  1337.  
  1338.        This function is especially useful when used in conjunction with
  1339.        DirChange, to save and then return to the current directory.
  1340.  
  1341.        Example:
  1342.         origdir = DirGet()
  1343.         DirChange("c:\windows\winword")
  1344.         Run("winword.exe", "")
  1345.         DirChange(origdir)
  1346.  
  1347.        FileExist (filename)
  1348.        Determines if a file exists.
  1349.  
  1350.        This function will return @TRUE if the specified file exists, and
  1351.        @FALSE if it doesn't exist.
  1352.  
  1353.        Example:
  1354.         If FileExist("win.bak") == @FALSE Then FileCopy("win.ini", 
  1355.             "win.bak", @FALSE)
  1356.         Run("notepad.exe", "win.ini")
  1357.  
  1358.  
  1359.        FileCopy (from-list, to-file, warning)
  1360.        Copies files.
  1361.  
  1362.        If warning is @TRUE, WinEdit will pop up a dialog box warning you if
  1363.        you are about to overwrite an existing file, and giving you an
  1364.        opportunity to change your mind.  If warning is @FALSE, it will
  1365.        overwrite existing files with no warning.
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.        Example:
  1372.         FileCopy("cmdpost.cpm", "*.sav", @TRUE)
  1373.         Run("notepad.exe", "cmdpost.cpm")
  1374.  
  1375.        The asterisk (*) is a wildcard character, which matches any letter or
  1376.        group of letters in a file name.  In this case, it will cause
  1377.        CMDPOST.CPM to be copied as CMDPOST.SAV.
  1378.  
  1379.  
  1380.        FileDelete (file-list)
  1381.        Deletes files.
  1382.  
  1383.        Example:
  1384.         If FileExist("win.bak") == @TRUE Then FileDelete("win.bak")
  1385.  
  1386.  
  1387.        FileRename (from-list, to-file)
  1388.        Renames files to another set of names.
  1389.  
  1390.  
  1391.  
  1392.        We can illustrate the use of these WIL file functions with a typical
  1393.        batch file application.  Let's suppose that our word processor saves a
  1394.        backup copy of each document, with a BAK extension, but we want a
  1395.        larger safety net when editing important files.  We want to keep the
  1396.        five most recent versions of the wonderful software manual we're
  1397.        writing.  Here's a WIL file to accomplish this:
  1398.  
  1399.         If FileExist("WIL.bak") == @TRUE Then Goto backup
  1400.         :edit
  1401.         Run("winword.exe", "WIL.doc")
  1402.         Exit
  1403.         :backup
  1404.         FileDelete("wil.bk5")
  1405.         FileRename("wil.bk4", "wil.bk5)
  1406.         FileRename("wil.bk3", "wil.bk4)
  1407.         FileRename("wil.bk2", "wil.bk3)
  1408.         FileRename("wil.bk1", "wil.bk2)
  1409.         FileRename("wil.bak", "wil.bk1)
  1410.         Goto edit
  1411.  
  1412.        If the file WINBATCH.BAK exists, it means that we have made a change
  1413.        to WINBATCH.DOC.  So, before we start editing, we delete the oldest
  1414.        backup copy, and perform several FileRename functions, until
  1415.        eventually WINBATCH.BAK becomes WINBATCH.BK1.  Notice how the flow of
  1416.        control moves to the line labeled :backup, and then back to the line
  1417.        labeled :edit, and how we terminate processing with the Exit command.
  1418.        If we did not include the Exit command, the batch file would continue
  1419.        in an endless loop.
  1420.  
  1421.        However, this still isn't quite right.  What would happen if the file
  1422.        WINBATCH.BK5 didn't exist?  In the DOS batch language, we would get an
  1423.        error message, and processing would continue.  But in WIL, the error
  1424.        would be fatal, and cause the batch file to abort:
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.        There are two ways that we can handle this.  We could use an If
  1442.        FileExist test before every file operation, and test the returned
  1443.        value for a @TRUE before proceeding.  But this is clumsy, even with
  1444.        such a small batch file, and would become unwieldy with a larger one.
  1445.  
  1446.  
  1447.  
  1448.  
  1449.        Handling Errors
  1450.        Luckily, there is a WIL system function to help us here: ErrorMode.
  1451.        The ErrorMode function determines what happens if an error occurs
  1452.        during batch file processing.  Here's the syntax:
  1453.  
  1454.  
  1455.        ErrorMode (mode)
  1456.        Specifies how to handle errors.
  1457.  
  1458.  
  1459.        Parameters:
  1460.         "mode" =     @CANCEL, @NOTIFY, or @OFF.
  1461.  
  1462.        Returns:
  1463.         (integer)    previous error setting.
  1464.  
  1465.        Use this command to control the effects of runtime errors.  The
  1466.        default is @CANCEL, meaning the execution of the batch file will be
  1467.        canceled for any error.
  1468.  
  1469.        @CANCEL:  All runtime errors will cause execution to be canceled.  The
  1470.        user will be notified which error occurred.
  1471.  
  1472.        @NOTIFY:  All runtime errors will be reported to the user, and they
  1473.        can choose to continue if it isn't fatal.
  1474.  
  1475.        @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  1476.        errors will be reported to the user.  User has the option of
  1477.        continuing if the error is not fatal.
  1478.  
  1479.        As you can see, the default mode is @CANCEL, and it's a good idea to
  1480.        leave it like this.  However, it is quite reasonable to change the
  1481.        mode for sections of your batch files where you anticipate errors
  1482.        occurring.  This is just what we've done in our modified batch file:
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.         If FileExist("wil.bak") == @TRUE Then Goto backup
  1489.         :edit
  1490.         Run("winword.exe", "wil.doc")
  1491.         Exit
  1492.         :backup
  1493.         ErrorMode(@OFF)
  1494.         FileDelete("wil.bk5")
  1495.         FileRename("wil.bk4", "wil.bk5)
  1496.         FileRename("wil.bk3", "wil.bk4)
  1497.         FileRename("wil.bk2", "wil.bk3)
  1498.         FileRename("wil.bk1", "wil.bk2)
  1499.         FileRename("wil.bak", "wil.bk1)
  1500.         ErrorMode(@CANCEL)
  1501.         Goto edit
  1502.  
  1503.        Notice how we've used ErrorMode(@OFF) to prevent errors in the section
  1504.        labeled backup: from aborting the batch file, and then used
  1505.        ErrorMode(@CANCEL) at the end of the that section to change back to
  1506.        the default error mode.  This is a good practice to follow.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.        Selection Menus
  1512.        So far, whenever we have needed to use a file name, we have hard-coded
  1513.        it into our WIL files.  For example:
  1514.  
  1515.         Run("notepad.exe", "agenda.txt")
  1516.  
  1517.        Naturally, there should be a way to get this information from the user
  1518.        "on the fly", so that we wouldn't have to write hundreds of different
  1519.        batch files.  And there is a way.  Two ways, actually.  Consider,
  1520.        first, a function that we have already seen, AskLine:
  1521.  
  1522.         file = AskLine("", "Enter Filename to edit?", "")
  1523.         Run("notepad.exe", file)
  1524.  
  1525.        This will prompt for a filename, and run Notepad on that file:
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.        There are only three problems with this approach.  First, the user
  1542.        might not remember the name of the file.  Second, the user might enter
  1543.        the name incorrectly.  And finally, modern software is supposed to be
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.        sophisticated and user-friendly enough to handle these things the
  1550.        right way.  And WIL certainly can.
  1551.  
  1552.        There are two new functions we need to use for our new, improved file
  1553.        selection routine: FileItemize and ItemSelect.
  1554.  
  1555.  
  1556.        FileItemize (file-list)
  1557.        Returns a space-delimited list of files.
  1558.  
  1559.        This function compiles a list of filenames and separates the names
  1560.        with spaces.  There are several variations we can use:
  1561.  
  1562.         FileItemize("*.doc")
  1563.  
  1564.        would give us a list of all files in the current directory with a DOC
  1565.        extension,
  1566.  
  1567.         FileItemize("*.com *.exe")
  1568.  
  1569.        would give us a list of all files in the current directory with a COM
  1570.        or EXE extension, and
  1571.  
  1572.         FileItemize("*.*")
  1573.  
  1574.        would give us a list of all files in the current directory.
  1575.  
  1576.        Of course, we need to be able to use this list, and for that we use:
  1577.  
  1578.  
  1579.        ItemSelect (title, list, delimiter)
  1580.        Displays a listbox filled with items from a list you specify in a
  1581.        string.  The items are separated in your string by a delimiter
  1582.        character.
  1583.  
  1584.        This is the function which actually displays the list box.  Remember
  1585.        that FileItemize returns a file list delimited by spaces, which would
  1586.        look something like this:
  1587.  
  1588.           FILE1.DOC FILE2.DOC FILE3.DOC
  1589.  
  1590.        When we use ItemSelect, we need to tell it that the delimiter is a
  1591.        space.  We do this as follows:
  1592.  
  1593.         textfiles = FileItemize("*.doc *.txt")
  1594.         yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1595.         Run("notepad.exe", yourfile)
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.        First, we use FileItemize to build a list of filenames with DOC and
  1620.        TXT extensions.  We assign this list to the variable textfiles.  Then,
  1621.        we use the ItemSelect function to build a list box, passing it the
  1622.        variable textfiles as its second parameter.  The third parameter we
  1623.        use for ItemSelect is simply a space with quote marks around it; this
  1624.        tells ItemSelect that the variable textfiles is delimited by spaces.
  1625.        Note that this is different from the null string that we've seen
  1626.        earlier -- here, you must include a space between the quote marks.
  1627.        Finally, we assign the value returned by ItemSelect to the variable
  1628.        yourfile, and run Notepad using that file.
  1629.  
  1630.        In the list box, if the user presses Enter or clicks on the OK button
  1631.        without a file being highlighted, ItemSelect returns a null string.
  1632.        If you want, you can test for this condition:
  1633.  
  1634.         textfiles = FileItemize("*.doc *.txt")
  1635.         :retry
  1636.         yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1637.         If yourfile == "" Then Goto retry
  1638.         Run("notepad.exe", yourfile)
  1639.  
  1640.        DirItemize (dir-list)
  1641.        Returns a space-delimited list of directories.
  1642.  
  1643.        This function is similar to FileItemize, but instead of returning a
  1644.        list of files, it returns a list of directories.  Remember we said
  1645.        that FileItemize only lists files in the current directory.  Often, we
  1646.        want to be able to use files in other directories as well.  We can do
  1647.        this by first letting the user select the appropriate directory, using
  1648.        the DirItemize and ItemSelect combination:
  1649.  
  1650.         DirChange("\")
  1651.         subdirs = DirItemize("*")
  1652.         targdir = ItemSelect("Select dir", subdirs, " ") 
  1653.             DirChange(targdir)
  1654.         files = FileItemize("*.*")
  1655.         file = ItemSelect("Select file", files, " ")
  1656.         Run("notepad.exe", file)
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.        First we change to the root directory.  Then we use DirItemize to get
  1663.        a list of all the subdirectories off of the root directory.  Next, we
  1664.        use ItemSelect to give us a list box of directories from which to
  1665.        select.  Finally, we change to the selected directory, and use
  1666.        FileItemize and ItemSelect to pick a file.
  1667.  
  1668.        Although this batch file works, it needs to be polished up a bit.
  1669.        What happens if the file we want is in the \WINDOWS\BATCH directory?
  1670.        Our batch file doesn't go more than one level deep from the root
  1671.        directory.  We want  to continue down the directory tree, but we also
  1672.        need a way of telling when we're at the end of a branch.  As it
  1673.        happens, there is such a way: DirItemize will return a null string if
  1674.        there are no directories to process.  Given this knowledge, we can set
  1675.        up a loop to test when we are at the lowest level:
  1676.  
  1677.         DirChange("\")
  1678.         :getdir
  1679.         subdirs = DirItemize("*")
  1680.         If subdirs == "" Then Goto getfile
  1681.         targdir = ItemSelect("Select dir (OK = curr)", subdirs, " ")
  1682.         If targdir == "" Then Goto getfile
  1683.         DirChange(targdir)
  1684.         Goto getdir
  1685.         :getfile
  1686.         files = FileItemize("*.*")
  1687.         file = ItemSelect("Select file", files, " ")
  1688.         If file == "" Then Goto getfile
  1689.         Run("notepad.exe", file)
  1690.  
  1691.        After we use the DirItemize function, we test the returned value for a
  1692.        null string.  If we have a null string, then we know that the current
  1693.        directory has no subdirectories, and so we proceed to select the
  1694.        filename from the current directory (Goto getfile) .  If, however,
  1695.        DirItemize returns a non-blank list, then we know that there is, in
  1696.        fact, at least one subdirectory.  In that case, we use ItemSelect to
  1697.        present the user with a list box of directories.  Then, we test the
  1698.        value returned by ItemSelect.  If the returned value is a null string,
  1699.        it means that the user did not select a directory from the list, and
  1700.        presumably wants a file in the current directory.  We happily oblige
  1701.        (Goto getfile).  On the other hand, a non-blank value returned by
  1702.        ItemSelect indicates that the user has selected a subdirectory from
  1703.        the list box.  In that case, we change to the selected directory, and
  1704.        loop back to the beginning of the directory selection routine (Goto
  1705.        getdir).  We continue this process until either (a) the user selects a
  1706.        directory, or (b) there are no directories left to select.
  1707.        Eventually, we get to the section of the batch file labeled :getfile.
  1708.  
  1709.  
  1710.  
  1711.  
  1712.        Nicer Display Boxes
  1713.        Have you tried displaying long messages, and found that WIL didn't
  1714.        wrap the lines quite the way you wanted?  Here are a couple of tricks.
  1715.  
  1716.  
  1717.        Num2Char (integer)
  1718.        Converts a number to its character equivalent.
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.        We want to be able to insert a carriage return/line feed combination
  1725.        at the end of each line in our output, and the Num2Char function will
  1726.        let us do that.  A carriage return has an ASCII value of 13, and a
  1727.        line feed has an ASCII value of 10 (don't worry if you don't
  1728.        understand what this sentence means).  To be able to use these values,
  1729.        we must convert them to characters, as follows:
  1730.  
  1731.         cr = Num2Char(13)
  1732.         lf = Num2Char(10)
  1733.  
  1734.        Now, we need to be able to place the variables cr and lf in our
  1735.        message.  For example, let's say we want to do this:
  1736.  
  1737.         Message("", "This is line one This is line two")
  1738.  
  1739.        If we just inserted the variables into the string, as in:
  1740.  
  1741.         cr = Num2Char(13)
  1742.         lf = Num2Char(10)
  1743.         Message("", "This is line one cr lf This is line two")
  1744.  
  1745.        we would not get the desired effect.  WIL would simply treat them as
  1746.        ordinary text:
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.        However, WIL does provide us with a method of performing variable
  1760.        substitution such as this, and that is by delimiting the variables
  1761.        with percentage signs (%).  If we do this:
  1762.  
  1763.         cr = Num2Char(13)
  1764.         lf = Num2Char(10)
  1765.         Message("", "This is line one %cr% %lf%This is line two")
  1766.  
  1767.        we will get what we want:
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.        Note that there is no space after %lf%; this is so that the second
  1774.        line will be aligned with the first line (every space within the
  1775.        delimiting quote marks of a string variable is significant).
  1776.  
  1777.        Now, wouldn't it be convenient if we could combine cr and lf into a
  1778.        single variable?  We can.
  1779.  
  1780.  
  1781.        StrCat (string[, string]...)
  1782.        Concatenates strings together.
  1783.  
  1784.        The StrCat function lets us combine any number of string constants
  1785.        and/or string variables.  Here's how we combine the variables cr and
  1786.        lf into the single variable crlf:
  1787.  
  1788.         crlf = StrCat(cr, lf)
  1789.  
  1790.        Note that the strings to be concatenated are separated by commas,
  1791.        within the parentheses.  Now, we can rewrite our example, as follows:
  1792.  
  1793.         cr = Num2Char(13)
  1794.         lf = Num2Char(10)
  1795.         crlf = StrCat(cr, lf)
  1796.         Message("", "This is line one %crlf%This is line two")
  1797.  
  1798.        If we wanted to re-use this message a number of times, it would be
  1799.        quite convenient to use the StrCat function to make a single variable
  1800.        out of it:
  1801.  
  1802.         cr = Num2Char(13)
  1803.         lf = Num2Char(10)
  1804.         crlf = StrCat(cr, lf)
  1805.         line1 = "This is line one"
  1806.         line2 = "This is line two"
  1807.         mytext = StrCat(line1, crlf, line2)
  1808.         Message("", mytext)
  1809.  
  1810.  
  1811.  
  1812.        Even Nicer Display Boxes
  1813.        For fancy dialog boxes, complete with all the bells and whistles, see
  1814.        the separate manual section on the DialogBox function (pg. 185).
  1815.  
  1816.  
  1817.  
  1818.  
  1819.        Running DOS Programs
  1820.        WIL can run DOS programs, just like it runs Windows programs:
  1821.  
  1822.         DirChange("c:\game")
  1823.         Run("scramble.exe", "")
  1824.  
  1825.        If you want to use an internal DOS command, such as DIR or TYPE, you
  1826.        can do so by running the DOS command interpreter, COMMAND.COM, with
  1827.        the /c program parameter, as follows:
  1828.  
  1829.         Run("command.com", "/c type readme.txt")
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.        Everything that you would normally type on the DOS command line goes
  1837.        after the /c in the second parameter.  Here's another example:
  1838.  
  1839.         Run("command.com", "/c type readme.txt | more")
  1840.  
  1841.        These examples assume that COMMAND.COM is in a directory on your DOS
  1842.        path.  If it isn't, you could specify a full path name for it:
  1843.  
  1844.         Run("c:\command.com", "/c type readme.txt | more")
  1845.  
  1846.        Or, better still, you could use the WIL Environment function.
  1847.  
  1848.  
  1849.        Environment (env-variable)
  1850.        Gets a DOS environment variable.
  1851.  
  1852.        Since DOS always stores the full path and filename of the command
  1853.        processor in the DOS environment variable COMSPEC, it is an easy
  1854.        matter to retrieve this information:
  1855.  
  1856.         coms = Environment("COMSPEC")
  1857.  
  1858.        and use it in our batch file:
  1859.  
  1860.         coms = Environment("COMSPEC")
  1861.         Run(coms, "/c type readme.txt")
  1862.  
  1863.        To get a DOS window, just run COMMAND.COM with no parameters:
  1864.  
  1865.         coms = Environment("COMSPEC")
  1866.         Run(coms, "")
  1867.  
  1868.  
  1869.  
  1870.        Sending Keystrokes to Programs
  1871.        Here we come to one of the most useful and powerful features of WIL:
  1872.        the ability to send keystrokes to Windows programs, just as if you
  1873.        were typing them directly from the keyboard.
  1874.  
  1875.  
  1876.        SendKey (character-codes)
  1877.        Sends keystrokes to the active application.
  1878.  
  1879.        This is an ideal way to make the computer automatically type the
  1880.        keystrokes that you enter every time you start a certain program.  For
  1881.        example, to start up Notepad and have it prompt you for a file to
  1882.        open, you would use:
  1883.  
  1884.         Run("notepad.exe", "")
  1885.         SendKey("!FO")
  1886.  
  1887.        The parameter you specify for SendKey is the string that you want sent
  1888.        to the program.  This string consists of standard characters, as well
  1889.        as some special characters which you will find listed under the entry
  1890.        for SendKey in the WIL Function Reference (pg. 145).  In the example
  1891.        above, the exclamation mark (!) stands for the Alt key, so !F is the
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.        equivalent of pressing and holding down the Alt key while
  1898.        simultaneously pressing the F key.  The O in the example above is
  1899.        simply the letter O, and is the same as pressing the O key by itself:
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.        Here's another example:
  1916.  
  1917.         RunZoom("sol.exe", "")
  1918.         SendKey("!GC{RIGHT}{SP}~")
  1919.  
  1920.        This starts up Solitaire, brings up the Game menu (!G), and selects
  1921.        Deck (C) from that menu:
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.        Then it moves the cursor to the next card back style on the right
  1936.        ({RIGHT}), selects that card back ({SP}), and then selects OK (~).
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.        And voila!  A different card design every time you play!
  1945.  
  1946.  
  1947.  
  1948.  
  1949.        Our Completed WIL File
  1950.        Here is the final working version of the SOLITARE.WBT file that we've
  1951.        slowly been building throughout this tutorial:
  1952.  
  1953.         ; solitare.wbt
  1954.         mins = AskLine("Solitaire", "How many minutes do you want to 
  1955.             play?", "")
  1956.         If WinExist("Solitaire") == @TRUE Then Goto activate
  1957.         RunZoom("sol.exe", "")
  1958.         Goto loaded
  1959.         :activate
  1960.         WinActivate("Solitaire")
  1961.         WinZoom("Solitaire")
  1962.         :loaded
  1963.         SendKey("!GC{RIGHT}{SP}~")
  1964.         goal = mins * 60
  1965.         timer = 0
  1966.         :moretime
  1967.         remain = goal - timer
  1968.         WinTitle("Solitaire", "Solitaire (%remain% seconds left)")
  1969.         Delay(10)
  1970.         timer = timer + 10
  1971.         If WinExist("Solitaire") == @FALSE Then Exit
  1972.         If timer < goal Then Goto moretime
  1973.         Beep
  1974.         WinClose("Solitaire")
  1975.         Message("Time's up", "Get back to work!")
  1976.  
  1977.        It incorporates many of the concepts that we've discussed so far, as
  1978.        well as using some arithmetic (*, -, +) and relational (<) operators
  1979.        that are covered in the section on the WIL Language (pg. 1).
  1980.  
  1981.        It can also be improved and customized in a number of ways.
  1982.  
  1983.        If you can understand and follow the structures and processes
  1984.        illustrated in this sample file, and can begin to incorporate them
  1985.        into your own WIL files, you are well on your way to becoming a true
  1986.        WIL guru!
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.                                     WIL LANGUAGE
  1994.  
  1995.  
  1996.  
  1997.  
  1998.        **Menu Structure
  1999.        Menus are defined in a menu file.  Each menu file consists of one or
  2000.        more lines of menu statements.  Each line is terminated with a
  2001.        carriage return / line feed (CRLF) combination and can be up to 256
  2002.        characters long.
  2003.  
  2004.        There are two main parts of a menu file:
  2005.  
  2006.        The first section, which is optional, is the initialization code.
  2007.        This section is executed once when the menu is first loaded and run.
  2008.        It's located before the first menu item declaration.
  2009.  
  2010.        The remainder of the menu file consists of menu item titles and their
  2011.        associated statements.  The code under each menu title is executed
  2012.        when the corresponding menu item is selected.  Execution begins at the
  2013.        first statement under a menu item and continues up to the definition
  2014.        of the next item.
  2015.  
  2016.  
  2017.  
  2018.  
  2019.        **Menu Items
  2020.        Menu titles can consist of letters, digits, spaces, punctuation marks;
  2021.        in fact any displayable ANSI characters your text editor can create.
  2022.  
  2023.        There are special characters you can use to modify the appearance of
  2024.        items in the menus.
  2025.  
  2026.        &    Causes the following character to be underlined in the menu item.
  2027.        The user can select the item by pressing the ALT key with the
  2028.        character instead of using the mouse.
  2029.  
  2030.        |  In a main menu, puts this item on a new line.
  2031.        |  In a dropdown menu, this item starts a new column.
  2032.        _  Used to create a horizontal bar (in dropdown menus only).
  2033.  
  2034.        Most WIL commands carry out functions based on your menu selections.
  2035.        However there are a few functions (summarized on pg. Error! Bookmark
  2036.                                                             Error! Bookmark
  2037.                                                             Error! Bookmark
  2038.        not defined.
  2039.        not defined.
  2040.        not defined.) that can alter the characteristics of the menu titles
  2041.        themselves.  For instance you can put a checkmark next to a menu, or
  2042.        disable and gray it.
  2043.  
  2044.        In order to identify a menu item within a WIL statement, each menu
  2045.        item you define has an associated menu name.  The menu name is built
  2046.        using only the letters and digits that make up the menu title.  Menu
  2047.        names are case-insensitive; you don't have to worry about how the
  2048.        actual menu title is capitalized in order to identify it.
  2049.  
  2050.        For menu items in a popup menu, the menu name consists of its parent
  2051.        menu's name, plus the popup menu item's name concatenated at the end.
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.        These menu names are valid as soon as the menu file is loaded, so you
  2058.        can use the menu management functions in the initialization code
  2059.        before the menus even appear.
  2060.  
  2061.        Example:
  2062.             PW=AskLine ("","Enter your password:", "")
  2063.             ;assuming the resident guru's pw is already in WIN.INI:
  2064.             RealPW = IniRead ("Our Company", "Tech Guru PW", "")
  2065.             Terminate (PW==RealPW, "Access", "You have FULL access")
  2066.  
  2067.             MenuChange("SystemUtilitiesCleanupDir",  @DISABLE)
  2068.             MenuChange("SystemUtilitiesEditBatFiles",@DISABLE)
  2069.             MenuChange("SystemUtilitiesEditWinIni",  @DISABLE)
  2070.             Message ("Access", "You have LIMITED access")
  2071.  
  2072.         &System Utilities  ;name = "SystemUtilities"
  2073.          &Cleanup Dir      ;name = "SystemUtilitiesCleanupDir"
  2074.             ...
  2075.          &Edit BAT Files...;name = "SystemUtilitiesEditBatFiles"
  2076.             ...
  2077.          &Edit WIN.INI     ;name = "SystemUtilitiesEditWinIni"
  2078.             ...
  2079.  
  2080.  
  2081.  
  2082.        Language Components
  2083.        WIL statements are constructed from constants, variables, operators,
  2084.        functions, commands, and comments.
  2085.  
  2086.        Each line in a WIL program can be up to 255 characters long.
  2087.  
  2088.  
  2089.  
  2090.  
  2091.        Constants
  2092.        The programming language supports both integer and string constants.
  2093.  
  2094.  
  2095.        Integer Constants
  2096.        Integer constants are built from the digits 0 through 9.  They can
  2097.        range in magnitude from negative to positive 231 -1  (approximately
  2098.        two billion).  Constants larger than these permissible magnitudes will
  2099.        produce unpredictable results.
  2100.  
  2101.        Examples of integer constants:
  2102.  
  2103.         1
  2104.         -45
  2105.         377849
  2106.         -1999999999
  2107.  
  2108.        String Constants
  2109.        String constants are comprised of displayable characters bounded by
  2110.        quote marks.  You can use double quotes ("), single quotes ('), or
  2111.        back quotes (`) to enclose a string constant, as long as the same type
  2112.        of quote is used to both start and end it.  If you need to embed the
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.        delimiting quote mark inside the string constant, use the delimiting
  2119.        quote mark twice.
  2120.  
  2121.        Examples of string constants:
  2122.  
  2123.         "a"
  2124.         `Betty Boop`
  2125.         "This constant has an embedded "" mark"
  2126.         'This constant also has an embedded " mark'
  2127.  
  2128.        Predefined Constants
  2129.        The programming language has a number of built-in integer constants
  2130.        that can be used for various purposes.  These start with the @-sign,
  2131.        and are case-insensitive (although we prefer to use ALL CAPS).
  2132.  
  2133.        Some predefined constants:
  2134.  
  2135.           @FALSE                              @TILE
  2136.           @NO                                 @TRUE
  2137.           @STACK                              @YES
  2138.  
  2139.  
  2140.  
  2141.        A list of all the predefined constants can be found in Appendix A (pg.
  2142.        185).
  2143.  
  2144.  
  2145.  
  2146.  
  2147.        Identifiers
  2148.        Identifiers are the names supplied for variables, functions, and
  2149.        commands in your program.
  2150.  
  2151.        An identifier is a sequence of one or more letters or digits that
  2152.        begins with a letter.  Identifiers may have up to 30 characters.
  2153.  
  2154.        All identifiers are case insensitive.  Upper- and lowercase characters
  2155.        may be mixed at will inside variable names, commands or functions.
  2156.  
  2157.        For example, these statements all mean the same thing:
  2158.  
  2159.         AskLine(MyTitle, Prompt, Default)
  2160.         ASKLINE(MYTITLE, PROMPT, DEFAULT)
  2161.         aSkLiNe(MyTiTlE, pRoMpT, dEfAuLt)
  2162.  
  2163.  
  2164.  
  2165.        Variables
  2166.        A variable may contain an integer, a string, a list, or a string
  2167.        representing an integer.  Automatic conversions between integers and
  2168.        strings are performed as a matter of course during execution.
  2169.  
  2170.        If a function requires a string parameter and an integer parameter is
  2171.        supplied, the variable will be automatically modified to include the
  2172.        representative string.
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.        If a function requires an integer parameter and a string parameter is
  2179.        supplied, an attempt will be made to convert the string to an integer.
  2180.        If it does not convert successfully, an error will result.
  2181.  
  2182.  
  2183.  
  2184.  
  2185.        Keywords
  2186.        "Keywords" are the predefined identifiers that have special meaning to
  2187.        the programming language.  These cannot be used as variable names.
  2188.  
  2189.        WIL keywords consist of the functions, commands, and predefined
  2190.        constants.
  2191.  
  2192.        Some examples of reserved keywords:
  2193.  
  2194.           Beep
  2195.           DirChange
  2196.           @Yes
  2197.           FileCopy
  2198.  
  2199.  
  2200.  
  2201.        Operators
  2202.        The programming language operators take one operand ("unary
  2203.        operators") or two operands ("binary operators").
  2204.  
  2205.        Unary operators (integers only):
  2206.           -      Arithmetic Negation (Two's complement)
  2207.           +      Identity (Unary plus)
  2208.           ~      Bitwise Not.  Changes each 0 bit to 1, and vice-versa.
  2209.           !      Logical Not.  Produces 0 (@FALSE) if the operand is nonzero,
  2210.                  else 1 (@TRUE) if the operand is zero.
  2211.  
  2212.  
  2213.        Binary arithmetic operators (integers only):
  2214.           *      Multiplication
  2215.           /      Division
  2216.           mod    Modulo
  2217.           +      Addition
  2218.           -      Subtraction
  2219.           <<     Left Shift
  2220.           >>     Right Shift
  2221.           &      Bitwise And
  2222.           |      Bitwise Or
  2223.           ^      Bitwise Exclusive Or  (XOR)
  2224.           &&     Logical And
  2225.           | |    Logical Or
  2226.  
  2227.  
  2228.        Binary relational operators (integers and strings):
  2229.           >      Greater-than
  2230.           >=     Greater-than or equal
  2231.           <      Less-than
  2232.           <=     Less-than or equal
  2233.           ==     Equality
  2234.           != or <>    Inequality
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.        Assignment operator (integers and strings):
  2241.           =      Assigns evaluated result of an expression to a variable
  2242.  
  2243.  
  2244.  
  2245.  
  2246.        Precedence and evaluation order
  2247.        The precedence of the operators affect the evaluation of operands in
  2248.        expressions.  Operands associated with higher-precedence operators are
  2249.        evaluated before the lower-precedence operators.
  2250.  
  2251.        The table below shows the precedence of the operators.  Where
  2252.        operators have the same precedence, they are evaluated from left to
  2253.        right.
  2254.  
  2255.        Operator            Description
  2256.           ( )              Parenthetical grouping
  2257.           ~ ! - +          Unary operators
  2258.           * / mod          Multiplication & Division
  2259.           + -              Addition & Subtraction
  2260.           <<  >>           Shift operators
  2261.           < <= == >= > != <>    Relational operators
  2262.           & ^ |            Bit manipulation operators
  2263.           && ||            Logical operators
  2264.  
  2265.  
  2266.  
  2267.        Comments
  2268.        A comment is a sequence of characters that are ignored when processing
  2269.        a command.  A semicolon (not otherwise part of a string constant)
  2270.        indicates the beginning of a comment.
  2271.  
  2272.        All characters to the right of the semicolon are considered comments,
  2273.        and are ignored.
  2274.  
  2275.        Blank lines are also ignored.
  2276.  
  2277.        Examples of comments:
  2278.         ; This is a comment
  2279.         abc = 5  ; This is also a comment
  2280.  
  2281.  
  2282.  
  2283.        Statements
  2284.  
  2285.        Assignment Statements
  2286.        Assignment statements are used to set variables to specific or
  2287.        computed values.  Variables may be set to integers or strings.
  2288.  
  2289.        Examples:
  2290.         a = 5
  2291.         value = Average(a, 10, 15)
  2292.         location = "Northern Hemisphere"
  2293.         world = StrCat(location, " ", "Southern Hemisphere")
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.        Control Statements
  2301.        Control statements are generally used to execute system management
  2302.        functions and consist of a call to a command without assigning any
  2303.        return values.
  2304.  
  2305.        Examples:
  2306.         Exit
  2307.         Yield
  2308.  
  2309.  
  2310.  
  2311.        Substitution
  2312.        The batch language has a powerful substitution feature which inserts
  2313.        the contents of a string variable into a statement before the line is
  2314.        parsed.
  2315.  
  2316.        To substitute the contents of a variable in the statement, simply put
  2317.        a percent-sign (%) on both sides of the variable name.
  2318.  
  2319.        Examples:
  2320.         mycmd = "DirChange('c:\')"   ;set mycmd to a command
  2321.         %mycmd%                 ;execute the command
  2322.  
  2323.        Or consider this one:
  2324.  
  2325.         IniWrite("PC", "User", "Richard")
  2326.         ...
  2327.         name = IniRead("PC", "User", "somebody")
  2328.         message("", "Thank you, %name%")
  2329.  
  2330.        will produce this message box:
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.        The variable substitution feature can be used to simulate an "array"
  2344.        of strings.  For example, if you wanted to read the lines contained in
  2345.        a file into an array of variables named line1 through line# (where #
  2346.        is the line number of the last line in the file), and then write them
  2347.        to a new file in reverse order, you could do so as follows:
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.         handle = FileOpen("c:\config.sys", "READ")
  2354.         num = 0
  2355.         :readnext
  2356.         num = num + 1
  2357.         line%num% = FileRead(handle)
  2358.         If line%num% != "*EOF*" Then Goto readnext
  2359.         FileClose(handle)
  2360.         handle = FileOpen("c:\config.rev", "WRITE")
  2361.         :writenext
  2362.         num = num - 1
  2363.         FileWrite(handle, line%num%)
  2364.         If num > 1 Then Goto writenext
  2365.         FileClose(handle)
  2366.         Message("Processing complete", "CONFIG.REV created")
  2367.  
  2368.  
  2369.        To put a single percent-sign (%) on a source line, specify a double
  2370.        percent sign(%%).  This is required even inside quoted strings.
  2371.  
  2372.        Note:  The length of a line, after any substitution occurs, may not
  2373.        exceed 255 characters.
  2374.  
  2375.  
  2376.  
  2377.  
  2378.        **Language Directives
  2379.        A "language directive" is a command to the WIL interpreter, as opposed
  2380.        to a menu statement.  These begin with a pound-sign ("#") in column 1.
  2381.  
  2382.        Currently there is only one directive recognized by Command Post:
  2383.        #NextFile. This directive tells the WIL interpreter to append another
  2384.        .CPM file to the current one before building the menus.  You can
  2385.        append only one extra menu file in this way.
  2386.  
  2387.  
  2388.  
  2389.  
  2390.        Function Parameters
  2391.        Most of the functions and commands in the language require parameters.
  2392.        These come in several types:
  2393.  
  2394.           Integer
  2395.           String
  2396.           List
  2397.           Variable name
  2398.  
  2399.  
  2400.        The interpreter performs automatic conversions between strings and
  2401.        integers, so in general you can use them interchangeably.
  2402.  
  2403.        Integer parameters may be any of the following:
  2404.  
  2405.           An integer (i.e. 23)
  2406.           A string representing an integer (i.e. "23")
  2407.           A variable containing an integer
  2408.           A variable containing a string representing an integer
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.        String parameters may be any of the following:
  2415.  
  2416.           A string
  2417.           An integer
  2418.           A variable containing a string
  2419.           A variable containing a list
  2420.           A variable containing an integer
  2421.  
  2422.  
  2423.  
  2424.  
  2425.        Error Handling
  2426.        There are three types of errors that can occur while processing a
  2427.        batch file:  Minor, Moderate, and Fatal.  What happens when an error
  2428.        occurs depends on the current error mode, which is set with the
  2429.        ErrorMode function.
  2430.  
  2431.        There are three possible modes you can specify:
  2432.  
  2433.        @CANCEL
  2434.           User is notified when any error occurs, and then the batch file is
  2435.           canceled.  This is the default.
  2436.  
  2437.        @NOTIFY
  2438.           User is notified when any error occurs, and has option to continue
  2439.           unless the error is fatal.
  2440.  
  2441.        @OFF
  2442.           User is only notified if the error is moderate or fatal.  User has
  2443.           option to continue unless the error is fatal.
  2444.  
  2445.        The function LastError returns the code of the most-recent error
  2446.        encountered during the current batch file.
  2447.  
  2448.        Minor errors are numbered from 1000 to 1999.
  2449.        Moderate errors are numbered from 2000 to 2999.
  2450.        Fatal errors are numbered from 3000 to 3999.
  2451.  
  2452.        Error handling is reset to @CANCEL at the start of each WIL program.
  2453.  
  2454.  
  2455.  
  2456.  
  2457.        The Functions & Statements
  2458.  
  2459.  
  2460.  
  2461.        Inputting Information
  2462.        AskLine (title, prompt, default)
  2463.           Lets user enter a line of information.
  2464.  
  2465.        AskPassword (title, prompt)
  2466.           Prompts the user for a password.
  2467.  
  2468.        AskYesNo (title, question)
  2469.           Lets user choose from Yes, No, or Cancel.
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.        ItemSelect (title, list, delimiter)
  2476.           Chooses an item from a listbox.
  2477.  
  2478.        TextBox (title, filename)
  2479.           Fills a listbox from text strings in a file.
  2480.  
  2481.        TextSelect (title, list, delimiter)
  2482.           Allows the user to choose an item from an unsorted listbox.
  2483.  
  2484.  
  2485.  
  2486.  
  2487.        Displaying Information
  2488.        Beep
  2489.           Beeps at the user.
  2490.  
  2491.        DialogBox (title, WDG file)
  2492.           Pops up a Windows dialog box defined by the WDG template file.
  2493.  
  2494.        Display (seconds, title, text)
  2495.           Momentarily displays a string.
  2496.  
  2497.        Message (title, text)
  2498.           Displays text in a message box.
  2499.  
  2500.        Pause (title, text)
  2501.           Displays text in a message box.
  2502.  
  2503.        TextBox (title, filename)
  2504.           Fills a listbox from text strings in a file.
  2505.  
  2506.        TextSelect (title, list, delimiter)
  2507.           Allows the user to choose an item from an unsorted listbox.
  2508.  
  2509.  
  2510.  
  2511.  
  2512.        File Management
  2513.        FileAppend (from-list, to-file)
  2514.           Appends one or more files to another file.
  2515.  
  2516.        FileAttrGet (filename)
  2517.           Returns file attributes.
  2518.  
  2519.        FileAttrSet (file-list, settings)
  2520.           Sets file attributes.
  2521.  
  2522.        FileClose (filehandle)
  2523.           Closes a file.
  2524.  
  2525.        FileCopy (from-list, to-file, warning)
  2526.           Copies files.
  2527.  
  2528.        FileDelete (file-list)
  2529.           Deletes files.
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.        FileExist (filename)
  2536.           Determines if a file exists.
  2537.  
  2538.        FileExtension (filename)
  2539.           Returns extension of file.
  2540.  
  2541.        FileItemize (file-list)
  2542.           Builds a list of files.
  2543.  
  2544.        FileLocate (filename)
  2545.           Finds a file within the current DOS path.
  2546.  
  2547.        FileMove (from-list, to-file, warning)
  2548.           Moves files to another set of pathnames.
  2549.  
  2550.        FileOpen (filename, open-type)
  2551.           Opens a STANDARD ASCII (only) file for reading or writing.
  2552.  
  2553.        FilePath (filename)
  2554.           Returns path of file.
  2555.  
  2556.        FileRead (filehandle)
  2557.           Reads data from a file.
  2558.  
  2559.        FileRename (from-list, to-file)
  2560.           Renames files to another set of names.
  2561.  
  2562.        FileRoot (filename)
  2563.           Returns root of file.
  2564.  
  2565.        FileSize (file-list)
  2566.           Adds up the total size of a set of files.
  2567.  
  2568.        FileTimeGet (filename)
  2569.           Returns file date and time.
  2570.  
  2571.        FileTimeTouch (file-list)
  2572.           Sets file(s) to current time.
  2573.  
  2574.        FileWrite (filehandle,output-data)
  2575.           Writes data to a file.
  2576.  
  2577.        IniDelete (section, keyname)
  2578.           Removes a line or section from WIN.INI.
  2579.  
  2580.        IniDeletePvt (section, keyname, filename)
  2581.           Removes a line or section from a private INI file.
  2582.  
  2583.        IniItemize (section)
  2584.           Lists keywords or sections in WIN.INI.
  2585.  
  2586.        IniItemizePvt (section, filename)
  2587.           Lists keywords or sections in a private INI file.
  2588.  
  2589.        IniRead (section, keyname, default)
  2590.           Reads a string from the WIN.INI file.
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.        IniReadPvt (section, keyname, default, filename)
  2597.           Reads a string from a private INI file.
  2598.  
  2599.        IniWrite (section, keyname, string)
  2600.           Writes a string to the WIN.INI file.
  2601.  
  2602.        IniWritePvt (section, keyname, data, filename)
  2603.           Writes a string to a private INI file.
  2604.  
  2605.  
  2606.  
  2607.  
  2608.        Directory Management
  2609.        DirChange ([d:]path)
  2610.           Changes the current directory.
  2611.  
  2612.        DirGet ( )
  2613.           Returns the current directory path.
  2614.  
  2615.        DirHome ( )
  2616.           Returns the initial directory path.
  2617.  
  2618.        DirItemize (dir-list)
  2619.           Builds a list of directories.
  2620.  
  2621.        DirMake ([d:]path)
  2622.           Creates a new directory.
  2623.  
  2624.        DirRemove ([d:]path)
  2625.           Removes an existing directory.
  2626.  
  2627.        DirRename ([d:]oldpath, [d:]newpath)
  2628.           Renames a directory.
  2629.  
  2630.        DirWindows (request#)
  2631.           Returns the name of the Windows or Windows System directory.
  2632.  
  2633.  
  2634.  
  2635.  
  2636.        Disk Drive Management
  2637.        DiskFree (drive-list)
  2638.           Returns the amount of free space on a set of drives.
  2639.  
  2640.        DiskScan (request#)
  2641.           Returns list of drives.
  2642.  
  2643.        LogDisk (drive)
  2644.           Changes the logged disk drive.
  2645.  
  2646.  
  2647.  
  2648.  
  2649.        Window Management
  2650.        AppExist (program-name)
  2651.           Tells if an application is running.
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.        AppWaitClose (program-name)
  2658.           Suspends WIL program execution until a specified application has
  2659.           been closed.
  2660.  
  2661.        IconArrange ( )
  2662.           Rearranges icons.
  2663.  
  2664.        WinActivate (partial-winname)
  2665.           Makes an application window the active window.
  2666.  
  2667.        WinArrange (style)
  2668.           Arranges all running application windows on the screen.
  2669.  
  2670.        WinClose (partial-winname)
  2671.           Closes an application window.
  2672.  
  2673.        WinCloseNot (partial-winname [, partial-winname...])
  2674.           Closes all application windows except those specified.
  2675.  
  2676.        WinExeName (partial-winname)
  2677.           Returns the name of the executable file which created a specified
  2678.           window.
  2679.  
  2680.        WinExist (partial-winname)
  2681.           Tells if window exists.
  2682.  
  2683.        WinGetActive ( )
  2684.           Gets the title of the active window.
  2685.  
  2686.        WinHide (partial-winname)
  2687.           Hides an application window.
  2688.  
  2689.        WinIconize (partial-winname)
  2690.           Turns an application window into an icon.
  2691.  
  2692.        WinItemize ( )
  2693.           Lists all the main windows currently running.
  2694.  
  2695.        WinName ( )
  2696.           Returns the name of the window calling the WIL Interpreter.
  2697.  
  2698.        WinPlace (x-ul, y-ul, x-br, y-br, partial-winname)
  2699.           Changes the size and position of an application window on the
  2700.           screen.
  2701.  
  2702.        WinPlaceGet (win-type, partial-winname)
  2703.           Returns window coordinates.
  2704.  
  2705.        WinPlaceSet (win-type, partial-winname, position-string)
  2706.           Sets window coordinates.
  2707.  
  2708.        WinPosition (partial-winname)
  2709.           Returns window position.
  2710.  
  2711.        WinShow (partial-winname)
  2712.           Shows a currently-hidden application window.
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.        WinState (partial-winname)
  2719.           Returns the current state of a window.
  2720.  
  2721.        WinTitle (partial-winname, new-winname)
  2722.           Changes the title of an application window.
  2723.  
  2724.        WinWaitClose (partial-winname)
  2725.           Waits until an application window is closed.
  2726.  
  2727.        WinZoom (partial-winname)
  2728.           Maximizes an application window to full-screen.
  2729.  
  2730.  
  2731.  
  2732.  
  2733.        Program Management
  2734.        Run (program-name, parameters)
  2735.           Runs a program as a normal window.
  2736.  
  2737.        RunHide (program-name, parameters)
  2738.           Runs a program in a hidden window.
  2739.  
  2740.        RunHideWait (program-name, parameters)
  2741.           Runs a program in a hidden window, and waits for it to close.
  2742.  
  2743.        RunIcon (program-name, parameters)
  2744.           Runs a program as an icon.
  2745.  
  2746.        RunIconWait (program-name, parameters)
  2747.           Runs a program as an icon, and waits for it to close.
  2748.  
  2749.        RunWait (program-name, parameters)
  2750.           Runs a program as a normal window, and waits for it to close.
  2751.  
  2752.        RunZoom (program-name, parameters)
  2753.           Runs a program in a maximized window.
  2754.  
  2755.        RunZoomWait (program-name, parameters)
  2756.           Runs a program in a maximized window, and waits for it to close.
  2757.  
  2758.  
  2759.  
  2760.  
  2761.        String Handling
  2762.        Char2Num (string)
  2763.           Returns the ANSI code of a string's first character.
  2764.  
  2765.        IsNumber (string)
  2766.           Determines if a string represents a valid number.
  2767.  
  2768.        ItemCount (list, delimiter)
  2769.           Returns the number of items in a list.
  2770.  
  2771.        ItemExtract (select, list, delimiter)
  2772.           Returns the selected item from a list.
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.        ItemInsert (item, index, list, delimiter)
  2779.           Adds an item to a list.
  2780.  
  2781.        ItemLocate (item, list, delimiter)
  2782.           Returns the position of an item in a list.
  2783.  
  2784.        ItemRemove (index, list, delimiter)
  2785.           Removes an item from a list.
  2786.  
  2787.        ItemSort (list, delimiter)
  2788.           Sorts a list.
  2789.  
  2790.        Num2Char (number)
  2791.           Converts a number to the ANSI character it represents.
  2792.  
  2793.        ParseData (string)
  2794.           Parses the passed string, just like passed parameters are parsed.
  2795.  
  2796.        StrCat (string[, string...])
  2797.           Concatenates strings together.
  2798.  
  2799.        StrCmp (string1, string2)
  2800.           Compares two strings.
  2801.  
  2802.        StrFill (string, string-length)
  2803.           Builds a string from a repeated smaller string.
  2804.  
  2805.        StrFix (base-string, padding-string, length)
  2806.           Pads or truncates a string to a fixed length.
  2807.  
  2808.        StriCmp (string1, string2)
  2809.           Compares two strings, ignoring their case.
  2810.  
  2811.        StrIndex (main-str, sub-str, start, direction)
  2812.           Locates a string within a larger string.
  2813.  
  2814.        StrLen (string)
  2815.           Returns the length of a string
  2816.  
  2817.        StrLower (string)
  2818.           Converts a string to all lower-case characters.
  2819.  
  2820.        StrReplace (string, old, new)
  2821.           Replaces all occurances of a substring with another.
  2822.  
  2823.        StrScan (main-str, delims, start, direction)
  2824.           Finds an occurrence of one or more delimiter characters in a
  2825.           string.
  2826.  
  2827.        StrSub (string, start, length)
  2828.           Returns a substring from within a string.
  2829.  
  2830.        StrTrim (string)
  2831.           Trims leading and trailing blanks from a string.
  2832.  
  2833.        StrUpper (string)
  2834.           Converts a string to all upper-case characters.
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.        Arithmetic Functions
  2844.        Abs (number)
  2845.           Returns the absolute value of a number.
  2846.  
  2847.        Average (num [, num...])
  2848.           Returns the average of a list of numbers.
  2849.  
  2850.        Max (num [, num...])
  2851.           Determines the highest number in a list.
  2852.  
  2853.        Min (num [, num...])
  2854.           Determines the lowest number in a list.
  2855.  
  2856.        Random (max)
  2857.           Generates a positive random number.
  2858.  
  2859.  
  2860.  
  2861.  
  2862.        Clipboard Handling
  2863.        ClipAppend (string)
  2864.           Appends a string to the end of the Clipboard.
  2865.  
  2866.        ClipGet ( )
  2867.           Returns the Clipboard contents into a string.
  2868.  
  2869.        ClipPut (string)
  2870.           Replaces the Clipboard contents with a string.
  2871.  
  2872.  
  2873.  
  2874.  
  2875.        Process Control
  2876.        Call (filename, parameters)
  2877.           Calls another WIL batch file as a subroutine.
  2878.  
  2879.        Debug (mode)
  2880.           Turns Debug mode on or off.
  2881.  
  2882.        Delay (seconds)
  2883.           Pauses batch file execution.
  2884.  
  2885.        Drop (var [, var...])
  2886.           Deletes variables to recover their memory.
  2887.  
  2888.        Else statement
  2889.           Continues a previous If statement.
  2890.  
  2891.        EndSession ( )
  2892.           Ends the current Windows session.
  2893.  
  2894.        ErrorMode (mode)
  2895.           Sets what happens in the event of an error.
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.        Exclusive (mode)
  2902.           Controls whether or not other Windows program will get any time to
  2903.           execute.
  2904.  
  2905.        Execute statement
  2906.           Directly executes a WIL statement.
  2907.  
  2908.        Exit
  2909.           Unconditionally ends a WIL program.
  2910.  
  2911.        Goto label
  2912.           Changes the flow of control in a batch file.
  2913.  
  2914.        If condition Then statement
  2915.           Conditionally performs a function.
  2916.  
  2917.        IgnoreInput (mode)
  2918.           Turns off hardware input to windows.
  2919.  
  2920.        IsDefined (variable)
  2921.           Determines if a variable is currently defined.
  2922.  
  2923.        IsKeyDown (key-codes)
  2924.           Tells about keys/mouse.
  2925.  
  2926.        LastError ( )
  2927.           Returns the last error encountered.
  2928.  
  2929.        Return
  2930.           Returns from a Call to the calling program.
  2931.  
  2932.        SKDebug (mode)
  2933.           Controls how SendKey works
  2934.  
  2935.        Terminate
  2936.           Conditionally ends a WIL program.
  2937.  
  2938.        Then statement
  2939.           Continues a previous If statement.
  2940.  
  2941.        WaitForKey
  2942.           Waits for a specific key to be pressed.
  2943.  
  2944.        Yield
  2945.           Pauses batch file processing so other applications can process some
  2946.           messages.
  2947.  
  2948.  
  2949.  
  2950.  
  2951.        Miscellaneous Functions
  2952.        IntControl (request#, p1, p2, p3, p4)
  2953.           Internal control functions.
  2954.  
  2955.        SendKey (character-codes)
  2956.           Sends keystrokes to the active application.
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.        SnapShot (request#)
  2963.           Takes a snapshot of the screen and pastes it to the clipboard.
  2964.  
  2965.        WallPaper (bmp-name, tile)
  2966.           Changes the Windows wallpaper.
  2967.  
  2968.        WinParmSet (request#, new-value, ini-control)
  2969.           Sets system information.
  2970.  
  2971.  
  2972.  
  2973.  
  2974.        System Information
  2975.        DateTime ( )
  2976.           Returns the current date and time.
  2977.  
  2978.        DOSVersion (level)
  2979.           Returns the version numbers of the current version of DOS.
  2980.  
  2981.        Environment (env-variable)
  2982.           Returns the value of a DOS environment variable.
  2983.  
  2984.        IsLicensed ( )
  2985.           Tells if the calling application is licensed.
  2986.  
  2987.        MouseInfo (request#)
  2988.           Returns assorted mouse information.
  2989.  
  2990.        Version ( )
  2991.           Returns the version of the parent program currently running.
  2992.  
  2993.        VersionDLL ( )
  2994.           Returns the version of the WIL Interpreter currently running.
  2995.  
  2996.        WinConfig ( )
  2997.           Returns WIN3 mode flags.
  2998.  
  2999.        WinMetrics (request#)
  3000.           Returns Windows system information.
  3001.  
  3002.        WinParmGet (request#)
  3003.           Returns system information.
  3004.  
  3005.        WinParmSet (request#, new-value, ini-control)
  3006.           Sets system information.
  3007.  
  3008.        WinResources (request#)
  3009.           Returns information on available memory and resources.
  3010.  
  3011.        WinVersion (level)
  3012.           Returns the version of Windows that is currently running.
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.        DDE Functions
  3022.        DDEExecute (channel, command string)
  3023.           Sends commands to a DDE server application.
  3024.  
  3025.        DDEInitiate (app name, topic name)
  3026.           Opens a DDE channel.
  3027.  
  3028.        DDEPoke (channel, item name, item value)
  3029.           Sends data to a DDE server application.
  3030.  
  3031.        DDERequest (channel, item name)
  3032.           Gets data from a DDE server application.
  3033.  
  3034.        DDETerminate (channel)
  3035.           Closes a DDE channel.
  3036.  
  3037.        DDETimeout (value)
  3038.           Sets the DDE timeout value.
  3039.  
  3040.  
  3041.  
  3042.  
  3043.        Network Functions
  3044.        NetAddCon (net-path, password, local-name)
  3045.           Connects network resources to imaginary local disk drives or
  3046.           printer ports.
  3047.  
  3048.        NetAttach (server-name)
  3049.           Attaches to a network file server.
  3050.  
  3051.        NetBrowse (request#)
  3052.           Displays a network dialog box allowing the user to select a network
  3053.           resource.
  3054.  
  3055.        NetCancelCon (name, force)
  3056.           Breaks a network connection.
  3057.  
  3058.        NetDetach (server-name)
  3059.           Detaches from a network file server.
  3060.  
  3061.        NetDialog ( )
  3062.           Brings up the network driver's dialog box.
  3063.  
  3064.        NetGetCaps (request#)
  3065.           Returns information on network capabilities.
  3066.  
  3067.        NetGetCon (local-name)
  3068.           Returns the name of a connected network resource.
  3069.  
  3070.        NetGetUser ( )
  3071.           Returns the name of the user currently logged into the network.
  3072.  
  3073.        NetLogin(server-name, user-name, password)
  3074.           Performs a network login.
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.        NetLogout(server-name)
  3081.           Performs a network logout.
  3082.  
  3083.        NetMapRoot(local-name, net-path)
  3084.           Maps a local drive to a network resource.
  3085.  
  3086.        NetMemberGet(server-name, group-name)
  3087.           Determines whether the current user is a member of a specific
  3088.           group.
  3089.  
  3090.        NetMemberSet(server-name, group-name)
  3091.           Sets the current user as a member of a group.
  3092.  
  3093.        NetMsgAll(server-name, message)
  3094.           Broadcasts a message to all users on the network.
  3095.  
  3096.        NetMsgSend(server-name, user-name, message)
  3097.           Sends a message to a specific user on the network.
  3098.  
  3099.  
  3100.  
  3101.  
  3102.        Multimedia Functions
  3103.        PlayMedia (command-string)
  3104.           Controls multimedia devices.
  3105.  
  3106.        PlayMidi (filename, mode)
  3107.           Plays a MID or RMI sound file.
  3108.  
  3109.        PlayWaveForm (filename, mode)
  3110.           Plays a WAV sound file.
  3111.  
  3112.        Sounds (request#)
  3113.           Turns sounds on or off.
  3114.  
  3115.  
  3116.  
  3117.  
  3118.        Menu Management
  3119.        CurrentFile ( )
  3120.           Returns the selected filename.
  3121.  
  3122.        IsMenuChecked (menuname)
  3123.           Determines if a menu item has a checkmark next to it.
  3124.  
  3125.        IsMenuEnabled (menuname)
  3126.           Determines if a menu item has been enabled.
  3127.  
  3128.        MenuChange (menuname, flags)
  3129.           Checks, unchecks, enables, or disables a menu item.
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.                                          WIL
  3137.                                       FUNCTION
  3138.                                       REFERENCE
  3139.  
  3140.  
  3141.  
  3142.  
  3143.        Introduction
  3144.        The WIL programming language consists of more than 150 functions and
  3145.        commands, which we describe in detail in this section.
  3146.  
  3147.        We use a shorthand notation to indicate the syntax of the functions.
  3148.  
  3149.        Function names and other actual characters you type are in boldface.
  3150.        Optional parameters are enclosed in square brackets "[ ]".  When a
  3151.        function takes a variable number of parameters, the variable parts
  3152.        will be followed by ellipses ("...").
  3153.  
  3154.        Take, for example, string concatenation:
  3155.  
  3156.        StrCat (string[, string...])
  3157.  
  3158.        This says that the StrCat function takes at least one string
  3159.        parameter.  Optionally, you can specify more strings to concatenate.
  3160.        If you do, you must separate the strings with commas.
  3161.  
  3162.        For each function and command, we show you the Syntax, describe the
  3163.        Parameters (if any), the value it Returns (if any), a description of
  3164.        the function, Example code (shown in Courier type), and related
  3165.        functions you may want to See Also.
  3166.  
  3167.  
  3168.  
  3169.        Items marked [*M] are available only in menu script usages (such as
  3170.        Command Post and File Commander).
  3171.  
  3172.  
  3173.  
  3174.        WIL Interpreter is a generic term which refers both to Command Post
  3175.        and to WIL.
  3176.  
  3177.        WIL program is a generic term which refers both to the script for a
  3178.        menu item and to a standalone batch file.
  3179.  
  3180.  
  3181.  
  3182.        (i) indicates an integer parameter or return value.
  3183.  
  3184.        (s) indicates a string parameter or return value.
  3185.  
  3186.  
  3187.  
  3188.  
  3189.        Abs
  3190.        Returns the absolute value of a number.
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.        Syntax:
  3198.         Abs (integer)
  3199.  
  3200.        Parameters:
  3201.         (i) integer  integer whose absolute value is desired.
  3202.  
  3203.        Returns:
  3204.         (i)          absolute value of integer.
  3205.  
  3206.        This function returns the absolute (positive) value of the integer
  3207.        which is passed to it, regardless of whether that integer is positive
  3208.        or negative.
  3209.  
  3210.  
  3211.        Example:
  3212.         dy = Abs(y1 - y2)
  3213.         Message("Years", "There are %dy% years 'twixt %y1% and %y2%")
  3214.  
  3215.  
  3216.        See Also:
  3217.           Average, IsNumber, Max, Min
  3218.  
  3219.  
  3220.  
  3221.  
  3222.        AppExist
  3223.        Tells if an application is running.
  3224.  
  3225.  
  3226.        Syntax:
  3227.         AppExist (program-name)
  3228.  
  3229.        Parameters:
  3230.         (s) program-name   name of a Windows EXE or DLL file.
  3231.  
  3232.        Returns:
  3233.         (i)          @TRUE if the specified application is running;
  3234.                      @FALSE if the specified application is not running.
  3235.  
  3236.        Use this function to determine whether a specific Windows application
  3237.        is currently running.  Unlike WinExist, you can use AppExist without
  3238.        knowing the title of the application's window.
  3239.  
  3240.        "Program-name" is the name of a Windows EXE or DLL file, including the
  3241.        file extension (and, optionally, a full path to the file).
  3242.  
  3243.  
  3244.        Example:
  3245.         If AppExist("clock.exe") == @FALSE Then Run("clock.exe", "")
  3246.  
  3247.  
  3248.        See Also:
  3249.           AppWaitClose, Run, WinExeName, WinExist
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.        AppWaitClose
  3259.        Suspends WIL program execution until a specified application has been
  3260.        closed.
  3261.  
  3262.  
  3263.        Syntax:
  3264.         AppWaitClose (program-name)
  3265.  
  3266.        Parameters:
  3267.         (s) program-name   name of a Windows EXE or DLL file.
  3268.  
  3269.        Returns:
  3270.         (i)          @TRUE if the specified application is running;
  3271.                      @FALSE if the specified application is not running.
  3272.  
  3273.        Use this function to suspend the WIL program's execution until the
  3274.        user has finished using a given application and has manually closed
  3275.        it.  Unlike WinWaitClose, you can use AppWaitClose without knowing the
  3276.        title of the application's window.
  3277.  
  3278.        "Program-name" is the name of a Windows EXE or DLL file, including the
  3279.        file extension (and, optionally, a full path to the file).
  3280.  
  3281.  
  3282.        Example:
  3283.         Run("clock.exe", "")
  3284.         Display(4, "Note", "Close Clock to continue")
  3285.         AppWaitClose("clock.exe")
  3286.         Message("Continuing...", "Clock closed")
  3287.  
  3288.  
  3289.        See Also:
  3290.           AppExist, Delay, RunWait, WinExeName, Yield
  3291.  
  3292.  
  3293.  
  3294.  
  3295.        AskLine
  3296.        Prompts the user for one line of input.
  3297.  
  3298.  
  3299.        Syntax:
  3300.         AskLine (title, prompt, default)
  3301.  
  3302.        Parameters:
  3303.         (s) title    title of the dialog box.
  3304.         (s) prompt   question to be put to the user.
  3305.         (s) default  default answer.
  3306.  
  3307.        Returns:
  3308.         (s)          user response.
  3309.  
  3310.        Use this function to query the user for a line of data.  The entire
  3311.        user response will be returned if the user presses the OK button or
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.        the Enter key.  If the user presses the Cancel button or the Esc key,
  3318.        the processing of the WIL program is canceled.
  3319.  
  3320.  
  3321.        Example:
  3322.         name = AskLine("Game", "Please enter your name", "")
  3323.         game = AskLine("Game", "Favorite game?", "Solitaire")
  3324.         message(StrCat(name,"'s favorite game is "), game)
  3325.  
  3326.        produces:
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.        And then, if Richard types "Scramble" and clicks on the OK button:
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.        See Also:
  3361.           AskPassword, AskYesNo, DialogBox, Display, ItemSelect, Message,
  3362.           Pause, TextBox, TextSelect
  3363.  
  3364.  
  3365.  
  3366.  
  3367.        AskPassword
  3368.        Prompts the user for a password.
  3369.  
  3370.  
  3371.        Syntax:
  3372.         AskPassword (title, prompt)
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.        Parameters:
  3380.         (s) title    title of the dialog box.
  3381.         (s) prompt   question to be put to the user.
  3382.  
  3383.        Returns:
  3384.         (s)          user response.
  3385.  
  3386.        Pops up a special dialog box to ask for a password.  An asterisk (*)
  3387.        is echoed for each character that the user types; the actual
  3388.        characters entered are not displayed.  The entire user response will
  3389.        be returned if the user presses the OK button or the Enter key.  If
  3390.        the user presses the Cancel button or the Esc key, the processing of
  3391.        the WIL program is canceled.
  3392.  
  3393.  
  3394.        Example:
  3395.         pw = AskPassword("Security check", "Please enter your password")
  3396.         If StriCmp(pw, "winguy") != 0 Then Goto nogo
  3397.         Run(Environment("COMSPEC"), "")
  3398.         Exit
  3399.         :nogo
  3400.         Pause("Security breach", "Invalid password entered")
  3401.  
  3402.  
  3403.        See Also:
  3404.           AskLine, AskYesNo, DialogBox
  3405.  
  3406.  
  3407.  
  3408.  
  3409.        AskYesNo
  3410.        Prompts the user for a Yes or No answer.
  3411.  
  3412.  
  3413.        Syntax:
  3414.         AskYesNo (title, question)
  3415.  
  3416.        Parameters
  3417.         (s) title    title of the question box.
  3418.         (s) question question to be put to the user.
  3419.  
  3420.        Returns:
  3421.         (i)          @YES or @NO, depending on the button pressed.
  3422.  
  3423.        This function displays a message box with three pushbuttons - Yes, No,
  3424.        and Cancel.  If the user presses Cancel, the current WIL program is
  3425.        ended, so there is no return value.
  3426.  
  3427.  
  3428.        Example:
  3429.         q = AskYesNo('Testing', 'Please press "YES"')
  3430.         If q == @YES Then Exit
  3431.         Display(3, 'ERROR', 'I said press "YES"')
  3432.  
  3433.        Produces:
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.        And then, if the user presses No:
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.        See Also:
  3458.           AskLine, AskPassword, DialogBox, Display, ItemSelect, Message,
  3459.           Pause, TextBox
  3460.  
  3461.  
  3462.  
  3463.  
  3464.        Average
  3465.        Returns the average of a list of numbers.
  3466.  
  3467.  
  3468.        Syntax:
  3469.         Average (integer [, integer...])
  3470.  
  3471.        Parameters:
  3472.         (i) integer  integers to get the average of.
  3473.  
  3474.        Returns:
  3475.         (i)          average of the integers.
  3476.  
  3477.        Use this function to compute the mean average of a series of numbers,
  3478.        delimited by commas.  This function returns an integer value, so there
  3479.        can be some rounding error involved.
  3480.  
  3481.  
  3482.        Example:
  3483.         avg = Average(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
  3484.         Message("The average is", avg)
  3485.  
  3486.  
  3487.        See Also:
  3488.           Abs, Max, Min, Random
  3489.  
  3490.  
  3491.  
  3492.  
  3493.        Beep
  3494.        Beeps once.
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.        Syntax:
  3502.         Beep
  3503.  
  3504.        Parameters:
  3505.         (none)
  3506.  
  3507.        Returns:
  3508.         (not applicable)
  3509.  
  3510.  
  3511.        Use this command to produce a short beep, generally to alert the user
  3512.        to an error situation or to get the user's attention.
  3513.  
  3514.  
  3515.        Example:
  3516.         Beep
  3517.         Pause("WARNING!!!", "You are about to destroy data!")
  3518.  
  3519.  
  3520.        See Also:
  3521.           PlayMedia, PlayMidi, PlayWaveForm, Sounds
  3522.  
  3523.  
  3524.  
  3525.  
  3526.        Call
  3527.        Calls another WIL batch file as a subroutine.
  3528.  
  3529.  
  3530.        Syntax:
  3531.         Call (filename, parameters)
  3532.  
  3533.        Parameters:
  3534.         (s) filename the WIL batch file you are calling (including
  3535.                      extension).
  3536.         (s) parameters     the parameters to pass to the file, if any, in the
  3537.                      form
  3538.                      "p1 p2 p3 ... pn".
  3539.  
  3540.        Returns:
  3541.         (i)          always 0.
  3542.  
  3543.  
  3544.        This function is used to pass control temporarily to a secondary WIL
  3545.        batch file.  The main WIL program can optionally pass parameters to
  3546.        the secondary WIL batch file.  All variables are common (global)
  3547.        between the calling program and the called WIL batch file, so that the
  3548.        secondary WIL batch file may modify or create variables.  The
  3549.        secondary WIL batch file should end with a Return statement, to pass
  3550.        control back to the main WIL program.
  3551.  
  3552.        If a string of parameters is passed to the secondary WIL batch file,
  3553.        it will automatically be parsed into individual variables with the
  3554.        names param1, param2, etc., (maximum of nine parameters).  The
  3555.        variable param0 will be a count of the total number of parameters in
  3556.        the string.
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.        Example:
  3564.         ; MAIN.WBT
  3565.         name = AskLine("", "What is your name?", "")
  3566.         age = AskLine("", "How old are you?", "")
  3567.         valid = @NO
  3568.         Call("chek-age.wbt", age)
  3569.         If valid == @NO Then Message("", "Invalid age")
  3570.  
  3571.         ; CHEK-AGE.WBT
  3572.         userage = param1
  3573.         really = AskYesNo("", "%name%, are you really %userage%?")
  3574.         If really == @NO Then Return
  3575.         If (userage > 0) && (userage < 150) Then valid = @YES
  3576.         Return
  3577.  
  3578.  
  3579.        See Also:
  3580.           ParseData, Return
  3581.  
  3582.  
  3583.  
  3584.  
  3585.        Char2Num
  3586.        Converts the first character of a string to its numeric equivalent.
  3587.  
  3588.  
  3589.        Syntax:
  3590.         Char2Num (string)
  3591.  
  3592.        Parameters:
  3593.         (s) string   any text string.  Only the first character will be
  3594.                      converted.
  3595.  
  3596.        Returns:
  3597.         (i)          ANSI character code.
  3598.  
  3599.        This function returns the 8-bit ANSI code corresponding to the first
  3600.        character of the string parameter.
  3601.  
  3602.        Note:  For the commonly-used characters (with codes below 128), ANSI
  3603.        and ASCII characters are identical.
  3604.  
  3605.  
  3606.        Example:
  3607.         ; Show the hex equivalent of entered character
  3608.         inpchar = AskLine("ANSI Equivalents", "Char:", "")
  3609.         ansi = StrSub(inpchar, 1, 1)
  3610.         ansiequiv = Char2Num(InpChar)
  3611.         Message("ANSI Codes", "%ansi% => %ansiequiv%")
  3612.  
  3613.  
  3614.        See Also:
  3615.           IsNumber, Num2Char
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.        ClipAppend
  3625.        Appends a string to the Clipboard.
  3626.  
  3627.  
  3628.        Syntax:
  3629.         ClipAppend (string)
  3630.  
  3631.        Parameters:
  3632.         (s) string   text string to add to Clipboard.
  3633.  
  3634.        Returns:
  3635.         (i)          @TRUE if string was appended;
  3636.                      @FALSE if Clipboard ran out of memory.
  3637.  
  3638.        Use this function to append a string to the Windows Clipboard.  The
  3639.        Clipboard must either contain text data or be empty for this function
  3640.        to succeed.
  3641.  
  3642.  
  3643.        Example:
  3644.         ; The code below will append 2 copies of the
  3645.         ; Clipboard contents back to the Clipboard, resulting
  3646.         ; in 3 copies of the original contents with a CR/LF
  3647.         ; between each copy.
  3648.         a = ClipGet()
  3649.         crlf = StrCat(Num2Char(13), Num2Char(10))
  3650.         ClipAppend(crlf)
  3651.         ClipAppend(a)
  3652.         ClipAppend(crlf)
  3653.         ClipAppend(a)
  3654.  
  3655.  
  3656.        See Also:
  3657.           ClipGet, ClipPut
  3658.  
  3659.  
  3660.  
  3661.  
  3662.        ClipGet
  3663.        Returns the contents of the Clipboard.
  3664.  
  3665.  
  3666.        Syntax:
  3667.         ClipGet ( )
  3668.  
  3669.        Parameters:
  3670.         (none)
  3671.  
  3672.        Returns:
  3673.         (s)          Clipboard contents.
  3674.  
  3675.        Use this function to copy text from the Windows Clipboard into a
  3676.        string variable.
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.        Note:  If the Clipboard contains an excessively large string a (fatal)
  3683.        out of memory error may occur.
  3684.  
  3685.  
  3686.        Example:
  3687.         ; The code below will convert Clipboard contents to
  3688.         ; uppercase
  3689.         ClipPut(StrUpper(ClipGet()))
  3690.         a = ClipGet()
  3691.         Message("UPPERCASE Clipboard Contents", a)
  3692.  
  3693.  
  3694.        See Also:
  3695.           ClipAppend, ClipPut
  3696.  
  3697.  
  3698.  
  3699.  
  3700.        ClipPut
  3701.        Copies a string to the Clipboard.
  3702.  
  3703.  
  3704.        Syntax:
  3705.         ClipPut (string)
  3706.  
  3707.        Parameters:
  3708.         (s) string   any text string.
  3709.  
  3710.        Returns:
  3711.         (i)          @TRUE if string was copied;
  3712.                      @FALSE if Clipboard ran out of memory.
  3713.  
  3714.        Use this function to copy a string to the Windows Clipboard.  The
  3715.        previous Clipboard contents will be lost.
  3716.  
  3717.  
  3718.        Example:
  3719.         ; The code below will convert Clipboard contents to
  3720.         ; lowercase
  3721.         ClipPut(StrLower(ClipGet()))
  3722.         a = ClipGet()
  3723.         Message("lowercase Clipboard Contents", a)
  3724.  
  3725.  
  3726.        See Also:
  3727.           ClipAppend, ClipGet, SnapShot
  3728.  
  3729.  
  3730.  
  3731.  
  3732.        CurrentFile [*M]
  3733.        Returns the selected filename.
  3734.  
  3735.  
  3736.        Syntax:
  3737.         CurrentFile ( )
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.        Parameters:
  3745.         (none)
  3746.  
  3747.        Returns:
  3748.         (s)          currently-selected file's name.
  3749.  
  3750.        When the WIL menu shell displays the files in the current directory,
  3751.        one of them may be "selected."  This function returns the name of that
  3752.        file, if any.
  3753.  
  3754.        This is different than a "highlighted" file.  When a file is
  3755.        highlighted, it shows up in inverse video (usually white-on-black).
  3756.        To find the filenames that are highlighted, see FileItemize.
  3757.  
  3758.        Note: This command is not part of the WIL Interpreter package, but is
  3759.        documented here because it has been implemented in many of the shell
  3760.        or file manager-type applications which use the WIL Interpreter.
  3761.  
  3762.  
  3763.        Example:
  3764.         ; ask which program to run (default = current file)
  3765.         thefile = AskLine("Run It", "Program:", CurrentFile())
  3766.         Run(thefile, "")
  3767.  
  3768.  
  3769.        See Also:
  3770.           DirGet, DirItemize, FileItemize
  3771.  
  3772.  
  3773.  
  3774.  
  3775.        DateTime
  3776.        Provides the current date and time.
  3777.  
  3778.  
  3779.        Syntax:
  3780.         DateTime ( )
  3781.  
  3782.        Parameters:
  3783.         (none)
  3784.  
  3785.        Returns:
  3786.         (s)          today's date and time
  3787.  
  3788.        This function will return the current date and time in a pre-formatted
  3789.        string.  The format it is returned in depends on how it is set up in
  3790.        the [Intl] section of the WIN.INI file:
  3791.  
  3792.        ddd mm/dd/yy hh:mm:ss XX
  3793.        ddd dd/mm/yy hh:mm:ss XX
  3794.        ddd yy/mm/dd hh:mm:ss XX
  3795.  
  3796.        Where:
  3797.           ddd is day of the week (e.g. Mon)
  3798.           mm  is the month (e.g. 10)
  3799.           dd  is the day of the month (e.g. 23)
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.           yy  is the year (e.g. 90)
  3806.           hh  is the hours
  3807.           mm  is the minutes
  3808.           ss  is the seconds
  3809.           XX  is the Day/Night code (e.g. AM or PM)
  3810.  
  3811.        Note:  Windows provides even more formatting options than this.
  3812.  
  3813.        The WIN.INI file will be examined to determine which format to use.
  3814.        You can adjust the WIN.INI file via the [Intl] section of Control
  3815.        Panel if the format isn't what you prefer.
  3816.  
  3817.  
  3818.        Example:
  3819.         ; assuming the current standard is U.S.
  3820.         ; (i.e. day  dd/mm/yy hh:mm:ss AM)
  3821.         Message("Current Date & Time", DateTime())
  3822.  
  3823.        would produce:
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.        See Also:
  3834.           FileTimeGet
  3835.  
  3836.  
  3837.  
  3838.  
  3839.        DDEExecute
  3840.        Sends commands to a DDE server application.
  3841.  
  3842.  
  3843.        Syntax:
  3844.         DDEExecute (channel, command string)
  3845.  
  3846.        Parameters:
  3847.         (i) channel  same integer that was returned by DDEInitiate.
  3848.         (s) command string one or more commands to be executed by the server
  3849.                      app.
  3850.  
  3851.        Returns:
  3852.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  3853.  
  3854.        Use the DDEInitiate function to obtain a channel number.
  3855.  
  3856.        In order to use this function successfully, you will need appropriate
  3857.        documentation for the server application you wish to access, which
  3858.        must provide information on the DDE functions that it supports and the
  3859.        correct syntax to use.
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.        Example:
  3867.         Run("wincheck.exe", "TUT")
  3868.         channel = DDEInitiate("wincheck", "TUT")
  3869.         If channel == 0 Then Goto failed
  3870.         result = DDEExecute(channel, '[WriteCheck:p="Shorewood 
  3871.             Apartments",t=580.00,l="Rent"]')
  3872.         DDETerminate(channel)
  3873.         WinClose("WinCheck")
  3874.         If result == @FALSE Then Goto Failed
  3875.         Message("DDE Execute", "Operation complete")
  3876.         Exit
  3877.         :failed
  3878.         Message("DDE operation unsuccessful", "Check your syntax")
  3879.  
  3880.  
  3881.        See Also:
  3882.           DDEInitiate, DDEPoke, DDERequest, DDETerminate, DDETimeout
  3883.  
  3884.  
  3885.  
  3886.  
  3887.        DDEInitiate
  3888.        Opens a DDE channel.
  3889.  
  3890.  
  3891.        Syntax:
  3892.         DDEInitiate (app name, topic name)
  3893.  
  3894.        Parameters:
  3895.         (s) app name name of the application (without the EXE extension).
  3896.         (s) topic name     name of the topic you wish to access.
  3897.  
  3898.        Returns:
  3899.         (i)          communications channel.
  3900.  
  3901.        This function opens a DDE communications channel with a server
  3902.        application.  The communications channel can be subsequently used by
  3903.        the DDEExecute, DDEPoke, and DDERequest functions.  You should close
  3904.        this channel with DDETerminate when you are finished using it.  If the
  3905.        communications channel cannot be opened as requested, DDEInitiate
  3906.        returns a channel number of 0.
  3907.  
  3908.        You can call DDEInitiate more than once, in order to carry on multiple
  3909.        DDE conversations (with multiple applications) simultaneously.
  3910.  
  3911.        In order to use this function successfully, you will need appropriate
  3912.        documentation for the server application you wish to access, which
  3913.        must provide information on the DDE functions that it supports and the
  3914.        correct syntax to use.
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.        Example:
  3922.         Run("wincheck.exe", "TUT")
  3923.         channel = DDEInitiate("WinCheck", "TUT")
  3924.         If channel == 0 Then Goto failed
  3925.         output = DDERequest(channel, "GetChecking")
  3926.         DDETerminate(channel)
  3927.         WinClose("WinCheck")
  3928.         If output == "" Then Goto Failed
  3929.         Message("Account balance", output)
  3930.         Exit
  3931.         :failed
  3932.         Message("DDE operation unsuccessful", "Check your syntax")
  3933.  
  3934.  
  3935.        See Also:
  3936.           DDEExecute, DDEPoke, DDERequest, DDETerminate, DDETimeout
  3937.  
  3938.  
  3939.  
  3940.  
  3941.        DDEPoke
  3942.        Sends data to a DDE server application.
  3943.  
  3944.  
  3945.        Syntax:
  3946.         DDEPoke (channel, item name, item value)
  3947.  
  3948.        Parameters:
  3949.         (i) channel  same integer that was returned by DDEInitiate.
  3950.         (s) item name identifies the type of data being sent.
  3951.         (s) item value     actual data to be sent to the server.
  3952.  
  3953.        Returns:
  3954.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  3955.  
  3956.        Use the DDEInitiate function to obtain a channel number.
  3957.  
  3958.        In order to use this function successfully, you will need appropriate
  3959.        documentation for the server application you wish to access, which
  3960.        must provide information on the DDE functions that it supports and the
  3961.        correct syntax to use.
  3962.  
  3963.  
  3964.        Example:
  3965.         Run("reminder.exe", "")
  3966.         channel = DDEInitiate("Reminder", "items")
  3967.         If channel == 0 Then Goto failed
  3968.         result = DDEPoke(channel, "all", "11/3/92 Misc Remember to vote")
  3969.         DDETerminate(channel)
  3970.         WinClose("Reminder")
  3971.         If result == @FALSE Then Goto Failed
  3972.         Message("DDE Poke", "Operation complete")
  3973.         Exit
  3974.         :failed
  3975.         Message("DDE operation unsuccessful", "Check your syntax")
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.        See Also:
  3983.           DDEExecute, DDEInitiate, DDERequest, DDETerminate, DDETimeout
  3984.  
  3985.  
  3986.  
  3987.  
  3988.        DDERequest
  3989.        Gets data from a DDE server application.
  3990.  
  3991.  
  3992.        Syntax:
  3993.         DDERequest (channel, item name)
  3994.  
  3995.        Parameters:
  3996.         (i) channel  same integer that was returned by DDEInitiate.
  3997.         (s) item name identifies the data to be returned by the server.
  3998.  
  3999.        Returns:
  4000.         (s)          information returned from the server.
  4001.  
  4002.        Use the DDEInitiate function to obtain a channel number.
  4003.  
  4004.        In order to use this function successfully, you will need appropriate
  4005.        documentation for the server application you wish to access, which
  4006.        must provide information on the DDE functions that it supports and the
  4007.        correct syntax to use.
  4008.  
  4009.  
  4010.        Example:
  4011.         Run("wincheck.exe", "TUT")
  4012.         channel = DDEInitiate("WinCheck", "TUT")
  4013.         If channel == 0 Then Goto failed
  4014.         output = DDERequest(channel, "GetChecking")
  4015.         DDETerminate(channel)
  4016.         WinClose("WinCheck")
  4017.         If output == "" Then Goto Failed
  4018.         Message("Account balance", output)
  4019.         Exit
  4020.         :failed
  4021.         Message("DDE operation unsuccessful", "Check your syntax")
  4022.  
  4023.  
  4024.        See Also:
  4025.           DDEExecute, DDEInitiate, DDEPoke, DDETerminate, DDETimeout
  4026.  
  4027.  
  4028.  
  4029.  
  4030.        DDETerminate
  4031.        Closes a DDE channel.
  4032.  
  4033.  
  4034.        Syntax:
  4035.         DDETerminate (channel)
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.        Parameters:
  4043.         (i) channel  same integer that was returned by DDEInitiate.
  4044.  
  4045.        Returns:
  4046.         (i)          always 1.
  4047.  
  4048.        This function closes a communications channel that was opened with
  4049.        DDEInitiate.
  4050.  
  4051.        Example:
  4052.         Run("wincheck.exe", "TUT")
  4053.         channel = DDEInitiate("WinCheck", "TUT")
  4054.         If channel == 0 Then Goto failed
  4055.         output = DDERequest(channel, "GetChecking")
  4056.         DDETerminate(channel)
  4057.         WinClose("WinCheck")
  4058.         If output == "" Then Goto Failed
  4059.         Message("Account balance", output)
  4060.         Exit
  4061.         :failed
  4062.         Message("DDE operation unsuccessful", "Check your syntax")
  4063.  
  4064.  
  4065.        See Also:
  4066.           DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETimeout
  4067.  
  4068.  
  4069.  
  4070.  
  4071.        DDETimeout
  4072.        Sets the DDE timeout value.
  4073.  
  4074.  
  4075.        Syntax:
  4076.         DDETimeout (value)
  4077.  
  4078.        Parameters:
  4079.         (i) value    DDE timeout time.
  4080.  
  4081.        Returns:
  4082.         (i)          previous timeout value.
  4083.  
  4084.        Sets the timeout time for subsequent DDE functions to specified value
  4085.        in milliseconds (1/1000 second).  Default is 3000 milliseconds (3
  4086.        seconds).  If the time elapses with no response, the WIL Interpreter
  4087.        will return an error.  The value set with DDETimeout stays in effect
  4088.        until changed by another DDETimeout statement or until the WIL program
  4089.        ends, whichever comes first.
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.        Example:
  4097.         DDETimeout(5000)
  4098.         Run("wincheck.exe", "TUT")
  4099.         channel = DDEInitiate("WinCheck", "TUT")
  4100.         If channel == 0 Then Goto failed
  4101.         output = DDERequest(channel, "GetChecking")
  4102.         DDETerminate(channel)
  4103.         WinClose("WinCheck")
  4104.         If output == "" Then Goto Failed
  4105.         Message("Account balance", output)
  4106.         Exit
  4107.         :failed
  4108.         Message("DDE operation unsuccessful", "Check your syntax")
  4109.  
  4110.  
  4111.        See Also:
  4112.           DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETerminate
  4113.  
  4114.  
  4115.  
  4116.  
  4117.        Debug
  4118.        Controls the debug mode.
  4119.  
  4120.  
  4121.        Syntax:
  4122.         Debug (mode)
  4123.  
  4124.        Parameters:
  4125.         (i) mode     @ON or @OFF
  4126.  
  4127.        Returns:
  4128.         (i)          previous debug mode
  4129.  
  4130.        Use this function to turn the debug mode on or off.  The default is
  4131.        @OFF.
  4132.  
  4133.        When debug mode is on, the WIL Interpreter will display the statement
  4134.        just executed, its result (if any), any error conditions, and the next
  4135.        statement to execute.
  4136.  
  4137.        The statements are displayed in a special dialog box which gives the
  4138.        user four options:  Next, Run, Cancel and Show Var.
  4139.  
  4140.        Next executes the next statement and remains in debug mode.
  4141.  
  4142.        Run exits debug mode and runs the rest of the program normally.
  4143.  
  4144.        Cancel terminates the current WIL program.
  4145.  
  4146.        Show Var displays the contents of a variable whose name the user
  4147.        entered in the edit box.
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.        Example:
  4155.         Debug(@ON)
  4156.         a = 6
  4157.         q = AskYesNo("Testing Debug Mode", "Is the Pope Catholic")
  4158.         Debug(@OFF)
  4159.         b = a + 4
  4160.  
  4161.        produces:
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.        ... then, if the user presses Next:
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.        ... and presses Next again:
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.        ... and then presses Yes:
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.        etc.  (If the user had pressed No it would have said "VALUE=>0".)
  4223.  
  4224.  
  4225.        See Also:
  4226.           ErrorMode, LastError, SKDebug
  4227.  
  4228.  
  4229.  
  4230.  
  4231.        Delay
  4232.        Pauses execution for a specified amount of time.
  4233.  
  4234.  
  4235.        Syntax:
  4236.         Delay (seconds)
  4237.  
  4238.        Parameters:
  4239.         (i) seconds  integer seconds to delay (2 - 3600)
  4240.  
  4241.        Returns:
  4242.         (i)          always 1
  4243.  
  4244.        This function causes the currently-executing WIL program to be
  4245.        suspended for the specified period of time.  Seconds must be an
  4246.        integer between 2 and 3600.  Smaller or larger numbers will be
  4247.        adjusted accordingly.
  4248.  
  4249.  
  4250.        Example:
  4251.         Message("Wait", "About 15 seconds")
  4252.         Delay(15)
  4253.         Message("Hi", "I'm Baaaaaaack")
  4254.  
  4255.  
  4256.        See Also:
  4257.           Yield
  4258.  
  4259.  
  4260.  
  4261.  
  4262.        DialogBox
  4263.        Pops up a Windows dialog box defined by the WDG template file.
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.        Syntax:
  4271.         DialogBox (title, WDG-file)
  4272.  
  4273.        Parameters:
  4274.         (s) title    the title of the dialog box.
  4275.         (s) WDG-file the name of the WDG template file.
  4276.  
  4277.        Returns:
  4278.         (i)          always 0.
  4279.  
  4280.        Each element in the template file is enclosed in square brackets, and
  4281.        consists of a variable name, followed by one of the following symbols:
  4282.  
  4283.           Symbol Meaning           Example
  4284.  
  4285.             +    check box         [backup+1Save backup]
  4286.             #    edit box          [newfile#   ]
  4287.             \    file selection listbox        [editfile\     ]
  4288.             ^    radio button      [prog^1Note]     [prog^2Write]
  4289.             $    variable          [var$]
  4290.  
  4291.        The number following the check box and radio button symbols is the
  4292.        value which will get assigned to the variable if its corresponding box
  4293.        is checked, or button is selected.  Following the number is the
  4294.        descriptive text which will appear next to the box or button.
  4295.  
  4296.        When used in conjunction with a file selection list box variable with
  4297.        the same name, two of these symbols have special meanings:
  4298.  
  4299.             #    file mask edit box            [editfile#     ]
  4300.             $    directory variable            [editfile$     ]
  4301.  
  4302.        Anything not appearing within square brackets is displayed as text.
  4303.  
  4304.        See the separate manual section on Dialog Boxes (pg. 185) for more
  4305.        detailed information on using this function.
  4306.  
  4307.  
  4308.        Example:
  4309.         DialogBox("Edit a file", "edit.wdg")
  4310.         If backup == 0 Then Goto nobackup
  4311.         filebackupname = StrCat(FileRoot(editfile), ".", "bak")
  4312.         FileCopy(editfile, filebackupname, @TRUE)
  4313.         :nobackup
  4314.         If prog == 1 Then Run("notepad.exe", editfile)
  4315.         If prog == 2 Then Run("c:\win\apps\winedit.exe", editfile)
  4316.  
  4317.        Here is the template file, EDIT.WDG:
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.         [editfile$       ]
  4324.              File mask [editfile#    ]
  4325.         [editfile\                      ]
  4326.         [editfile\                      ]
  4327.         [editfile\                      ]
  4328.         [editfile\                      ]
  4329.         [editfile\                      ]
  4330.         [backup+1Save backup of file]
  4331.         [prog^1Notepad]     [prog^2WinEdit]
  4332.  
  4333.  
  4334.        See Also:
  4335.           AskLine, AskPassword, AskYesNo, ItemSelect
  4336.  
  4337.  
  4338.  
  4339.  
  4340.        DirChange
  4341.        Changes the current directory.  Can also log a new drive.
  4342.  
  4343.  
  4344.        Syntax:
  4345.         DirChange ([d:]path)
  4346.  
  4347.        Parameters:
  4348.         (s) [d:]     an optional disk drive to log onto.
  4349.         (s) path     the desired path.
  4350.  
  4351.        Returns:
  4352.         (i)          @TRUE if directory was changed;
  4353.                      @FALSE if the path could not be found.
  4354.  
  4355.        Use this function to change the current working directory to another
  4356.        directory, either on the same or a different disk drive.
  4357.  
  4358.  
  4359.        Example:
  4360.         DirChange("c:\")
  4361.         TextBox("This is your CONFIG.SYS file", "config.sys")
  4362.  
  4363.  
  4364.        See Also:
  4365.           DirGet, DirHome, LogDisk
  4366.  
  4367.  
  4368.  
  4369.  
  4370.        DirGet
  4371.        Gets the current working directory.
  4372.  
  4373.  
  4374.        Syntax:
  4375.         DirGet ( )
  4376.  
  4377.        Parameters:
  4378.         (none)
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.        Returns:
  4386.         (s)          current working directory.
  4387.  
  4388.        Use this function to determine which directory we are currently in.
  4389.        It's especially useful when changing drives or directories
  4390.        temporarily.
  4391.  
  4392.  
  4393.        Example:
  4394.         ; Get, then restore current working directory
  4395.         origdir = DirGet()
  4396.         DirChange("c:\")
  4397.         FileCopy("config.sys", "%origdir%xxxtemp.xyz", @FALSE)
  4398.         DirChange(origdir)
  4399.  
  4400.  
  4401.        See Also:
  4402.           CurrentFile, DirHome, DirWindows
  4403.  
  4404.  
  4405.  
  4406.  
  4407.        DirHome
  4408.        Returns directory containing the WIL Interpreter's executable files.
  4409.  
  4410.  
  4411.        Syntax:
  4412.         DirHome ( )
  4413.  
  4414.        Parameters:
  4415.         (none)
  4416.  
  4417.        Returns:
  4418.         (s)          pathname of the home directory.
  4419.  
  4420.        Use this function to determine the directory where the current WIL
  4421.        Interpreter's executable files are stored.
  4422.  
  4423.  
  4424.        Example:
  4425.         a = DirHome()
  4426.         Message("WIL Executable is in ", a)
  4427.  
  4428.  
  4429.        See Also:
  4430.           DirGet, DirWindows
  4431.  
  4432.  
  4433.  
  4434.  
  4435.        DirItemize
  4436.        Returns a space-delimited list of directories.
  4437.  
  4438.  
  4439.        Syntax:
  4440.         DirItemize (dir-list)
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.        Parameters:
  4448.         (s) dir-list a string containing a set of subdirectory names, which
  4449.                      may be wildcarded.
  4450.  
  4451.        Returns:
  4452.         (s)          list of directories.
  4453.  
  4454.        This function compiles a list of subdirectories and separates the
  4455.        names with spaces.
  4456.  
  4457.        This is especially useful in conjunction with the ItemSelect function,
  4458.        which enables the user to choose an item from such a space-delimited
  4459.        list.
  4460.  
  4461.        DirItemize("*.*") returns all subdirectories under the current
  4462.        directory.
  4463.  
  4464.        Note: Some shell or file manager applications using the WIL
  4465.        Interpreter allow an empty string ("") to be used as the "dir-list"
  4466.        parameter, in which case all subdirectories highlighted in the file
  4467.        display are returned.  However, if there are any directory names or
  4468.        wildcards in the string, all subdirectories matching the pathnames are
  4469.        returned, regardless of which ones are highlighted.
  4470.  
  4471.  
  4472.        Example:
  4473.         a = DirItemize("*.*")
  4474.         ItemSelect("Directories", a, " ")
  4475.  
  4476.  
  4477.        See Also:
  4478.           CurrentFile, FileItemize, ItemSelect, TextSelect, WinItemize
  4479.  
  4480.  
  4481.  
  4482.  
  4483.        DirMake
  4484.        Creates a new directory.
  4485.  
  4486.  
  4487.        Syntax:
  4488.         DirMake ([d:]path)
  4489.  
  4490.        Parameters:
  4491.         (s) [d:]     the desired disk drive.
  4492.         (s) path     the path to create.
  4493.  
  4494.        Returns:
  4495.         (i)          @TRUE if the directory was successfully created;
  4496.                      @FALSE if it wasn't.
  4497.  
  4498.        Use this function to create a new directory.
  4499.  
  4500.  
  4501.        Example:
  4502.         DirMake("c:\xxxstuff")
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.        See Also:
  4511.           DirRemove, DirRename
  4512.  
  4513.  
  4514.  
  4515.  
  4516.        DirRemove
  4517.        Removes a directory.
  4518.  
  4519.  
  4520.        Syntax:
  4521.         DirRemove (dir-list)
  4522.  
  4523.        Parameters:
  4524.         (s) dir-list a space-delimited list of directory pathnames.
  4525.  
  4526.        Returns:
  4527.         (i)          @TRUE if the directory was successfully removed;
  4528.                      @FALSE if it wasn't.
  4529.  
  4530.        Use this function to delete directories.  You can delete one or more
  4531.        at a time by separating directory names with spaces.  You cannot,
  4532.        however, use wildcards.
  4533.  
  4534.  
  4535.        Examples:
  4536.         DirRemove("c:\xxxstuff")
  4537.  
  4538.         DirRemove("tempdir1 tempdir2 tempdir3")
  4539.  
  4540.  
  4541.        See Also:
  4542.           DirMake, DirRename
  4543.  
  4544.  
  4545.  
  4546.  
  4547.        DirRename
  4548.        Renames a directory.
  4549.  
  4550.  
  4551.        Syntax:
  4552.         DirRename ([d:]oldpath, [d:]newpath)
  4553.  
  4554.        Parameters:
  4555.         (s) oldpath  existing directory name, with optional drive.
  4556.         (s) newpath  new name for directory.
  4557.  
  4558.        Returns:
  4559.         (i)          @TRUE if the directory was successfully renamed;
  4560.                      @FALSE if it wasn't.
  4561.  
  4562.  
  4563.        Example:
  4564.         DirRename("c:\temp", "c:\work")
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.        See Also:
  4573.           DirMake, DirRemove
  4574.  
  4575.  
  4576.  
  4577.  
  4578.        DirWindows
  4579.        Returns the name of the Windows or Windows System directory.
  4580.  
  4581.  
  4582.        Syntax:
  4583.         DirWindows (request#)
  4584.  
  4585.        Parameters:
  4586.         (i) request# see below.
  4587.  
  4588.  
  4589.        Returns:
  4590.         (s)          directory name.
  4591.  
  4592.        This function returns the name of either the Windows directory or the
  4593.        Windows System directory, depending on the request# specified.
  4594.  
  4595.           Req#   Return value
  4596.  
  4597.           0      Windows directory
  4598.           1      Windows System directory
  4599.  
  4600.  
  4601.        Example:
  4602.         DirChange(DirWindows(0))
  4603.         ini = ItemSelect("Select file to edit", FileItemize("*.ini"), " ")
  4604.         Run("notepad.exe", ini)
  4605.  
  4606.  
  4607.        See Also:
  4608.           DirGet, DirHome
  4609.  
  4610.  
  4611.  
  4612.  
  4613.        DiskFree
  4614.        Finds the total space available on a group of drives.
  4615.  
  4616.  
  4617.        Syntax:
  4618.         DiskFree (drive-list)
  4619.  
  4620.        Parameters:
  4621.         (s) drive-list     one or more drive letters, separated by spaces.
  4622.  
  4623.        Returns:
  4624.         (i)          the number of bytes available on all the specified
  4625.                      drives.
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.        This function takes a string consisting of drive letters, separated by
  4632.        spaces.  Only the first character of each non-blank group of
  4633.        characters is used to determine the drives, so you can use just the
  4634.        drive letters, or add a colon (:), or add a backslash (\), or even a
  4635.        whole pathname, and still get a perfectly valid result.
  4636.  
  4637.  
  4638.        Example:
  4639.         size = DiskFree("c d")
  4640.         Message("Space Available on C: and D:", size)
  4641.  
  4642.  
  4643.        See Also:
  4644.           DiskScan, FileSize
  4645.  
  4646.  
  4647.  
  4648.  
  4649.        DiskScan
  4650.        Returns list of drives.
  4651.  
  4652.  
  4653.        Syntax:
  4654.         DiskScan (request#)
  4655.  
  4656.        Parameters:
  4657.         (i) request# see below.
  4658.  
  4659.        Returns:
  4660.         (s)          drive list.
  4661.  
  4662.        Scans disk drives on the system, and returns a space-delimited list of
  4663.        drives of the type specified by request#, in the form "A: B: C: D: ".
  4664.  
  4665.        The request# is a bitmask, so adding the values together (except for
  4666.        0) returns all drive types specified; eg., a request# of 3 returns
  4667.        floppy plus local hard drives.
  4668.  
  4669.           Req#   Return value
  4670.  
  4671.           0      List of unused disk IDs
  4672.           1      List of removable (floppy) drives
  4673.           2      List of local fixed (hard) drives
  4674.           4      List of remote (network) drives
  4675.  
  4676.  
  4677.        Example:
  4678.         hd = DiskScan(2)
  4679.         Message("Hard drives on system", hd)
  4680.  
  4681.  
  4682.        See Also:
  4683.           DiskFree, LogDisk
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.        Display
  4693.        Displays a message to the user for a specified period of time.
  4694.  
  4695.  
  4696.        Syntax:
  4697.         Display (seconds, title, text)
  4698.  
  4699.        Parameters:
  4700.         (i) seconds  seconds to display the message (1-3600).
  4701.         (s) title    title of the window to be displayed.
  4702.         (s) text     text of the window to be displayed.
  4703.  
  4704.        Returns:
  4705.         (i)          always 1.
  4706.  
  4707.        Use this function to display a message for a few seconds, and then
  4708.        continue processing without user input.
  4709.  
  4710.        Seconds must be an integer between 1 and 3600.  Smaller or larger
  4711.        numbers will be adjusted accordingly.
  4712.  
  4713.        The display box may be prematurely canceled by the user by clicking a
  4714.        mouse button, or hitting any key.
  4715.  
  4716.  
  4717.        Example:
  4718.         Display(3, "Current window is", WinGetActive())
  4719.  
  4720.        which produces something like this:
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.        See Also:
  4729.           Message, Pause
  4730.  
  4731.  
  4732.  
  4733.  
  4734.        DOSVersion
  4735.        Returns the version numbers of the current version of DOS.
  4736.  
  4737.  
  4738.        Syntax:
  4739.         DOSVersion (level)
  4740.  
  4741.        Parameters:
  4742.         (i) level    @MAJOR or @MINOR.
  4743.  
  4744.        Returns:
  4745.         (i)          integer or decimal part of DOS version number.
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.        @MAJOR returns the integer part (to the left of the decimal).
  4753.        @MINOR returns the decimal part (to the right of the decimal).
  4754.  
  4755.        If the version of DOS in use is 5.0, then:
  4756.  
  4757.           DOSVersion(@MAJOR)    ==   5
  4758.           DOSVersion(@MINOR)    ==   0
  4759.  
  4760.  
  4761.        Example:
  4762.         i = DOSVersion(@MAJOR)
  4763.         d = DOSVersion(@MINOR)
  4764.         If StrLen(d) == 1 Then d = StrCat("0", d)
  4765.         Message("DOS Version", "%i%.%d%")
  4766.  
  4767.  
  4768.        See Also:
  4769.           Environment, Version, WinVersion
  4770.  
  4771.  
  4772.  
  4773.  
  4774.        Drop
  4775.        Removes variables from memory.
  4776.  
  4777.  
  4778.        Syntax:
  4779.         Drop (var, [var...])
  4780.  
  4781.        Parameters:
  4782.         (i) var      variable names to remove.
  4783.  
  4784.        Returns:
  4785.         (i)          always 1.
  4786.  
  4787.        This function removes variables from the WIL Interpreter's variable
  4788.        list, and recovers the memory associated with the variable (and
  4789.        possibly related string storage).
  4790.  
  4791.  
  4792.        Example:
  4793.         a = "A variable"
  4794.         b = "Another one"
  4795.         Drop(a, b)       ; This removes A and B from memory
  4796.  
  4797.  
  4798.        See Also:
  4799.           IsDefined
  4800.  
  4801.  
  4802.  
  4803.  
  4804.        Else
  4805.        Continues a previous If statement.
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.        Syntax:
  4813.         Else statement
  4814.  
  4815.        Parameters:
  4816.         (s) statement any valid WIL function or command.
  4817.  
  4818.        This command continues the last-encountered If command.  It allows the
  4819.        user to specify an alternate action to be taken if the If condition
  4820.        was false.  If the previous If condition was false, the statement
  4821.        following the Else keyword is executed.  If the previous If condition
  4822.        was true, the statement following the Else keyword is ignored.
  4823.  
  4824.  
  4825.        Example:
  4826.         windir = DirWindows(0)
  4827.         inifiles = FileItemize("%windir%*.ini")
  4828.         ini = ItemSelect("INI file to edit", inifiles, " ")
  4829.         If ini == "" Then Exit
  4830.         Else Run("notepad.exe", ini)
  4831.  
  4832.  
  4833.        See Also:
  4834.           Goto, If ... Then, Then
  4835.  
  4836.  
  4837.  
  4838.  
  4839.        EndSession
  4840.        Ends the Windows session.
  4841.  
  4842.  
  4843.        Syntax:
  4844.         EndSession ( )
  4845.  
  4846.        Parameters:
  4847.         (none)
  4848.  
  4849.        Returns:
  4850.         (i)          always 0.
  4851.  
  4852.        Use this command to end the Windows session.
  4853.  
  4854.  
  4855.        Example:
  4856.         sure = AskYesNo ("End Session", "You SURE you want to exit 
  4857.             Windows?")
  4858.         If sure == @No Then Goto cancel
  4859.         EndSession()
  4860.         :cancel
  4861.         Message("", "Exit Windows canceled")
  4862.  
  4863.  
  4864.        See Also:
  4865.           Exit, WinClose, WinCloseNot
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.        Environment
  4875.        Gets a DOS environment variable.
  4876.  
  4877.  
  4878.        Syntax:
  4879.         Environment (env-variable)
  4880.  
  4881.        Parameters:
  4882.         (s) env-variable   any defined environment variable.
  4883.  
  4884.        Returns:
  4885.         (s)          environment variable contents.
  4886.  
  4887.        Use this function to get the value of a DOS environment variable.
  4888.  
  4889.        Note: It is not possible to change a DOS environment variable.
  4890.  
  4891.  
  4892.        Example:
  4893.         ; Display the PATH for this DOS session
  4894.         currpath = Environment("PATH")
  4895.         Message("Current DOS Path", currpath)
  4896.  
  4897.  
  4898.        See Also:
  4899.           IniRead, Version, WinMetrics, WinParmGet
  4900.  
  4901.  
  4902.  
  4903.  
  4904.        ErrorMode
  4905.        Specifies how to handle errors.
  4906.  
  4907.  
  4908.        Syntax:
  4909.         ErrorMode (mode)
  4910.  
  4911.        Parameters:
  4912.         (i) mode     @CANCEL or @NOTIFY or @OFF.
  4913.  
  4914.        Returns:
  4915.         (i)          previous error setting.
  4916.  
  4917.        Use this function to control the effects of runtime errors.  The
  4918.        default is @CANCEL, meaning the execution of the WIL program will be
  4919.        canceled upon any error.
  4920.  
  4921.        @CANCEL:  All runtime errors will cause execution to be canceled.  The
  4922.        user will be notified which error occurred.
  4923.  
  4924.        @NOTIFY:  All runtime errors will be reported to the user, and the
  4925.        user can choose to continue if it isn't fatal.
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.        @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  4932.        errors will be reported to the user.  User has the option of
  4933.        continuing if the error is not fatal.
  4934.  
  4935.        In general, we suggest the normal state of the program should be
  4936.        ErrorMode(@CANCEL), especially if you are writing a WIL program for
  4937.        others to use.  You can always suppress errors you expect will occur
  4938.        and then re-enable ErrorMode (@CANCEL).
  4939.  
  4940.  
  4941.        Example:
  4942.         ; Delete xxxtest.xyz.  If file doesn't exist,
  4943.         ; continue execution; don't stop
  4944.         prevmode = ErrorMode(@OFF)
  4945.         FileDelete("c:\xxxtest.xyz")
  4946.         ErrorMode(prevmode)
  4947.  
  4948.  
  4949.        See Also:
  4950.           Debug, Execute, LastError
  4951.  
  4952.  
  4953.  
  4954.  
  4955.        Exclusive
  4956.        Controls whether or not other Windows programs will get any time to
  4957.        execute.
  4958.  
  4959.  
  4960.        Syntax:
  4961.         Exclusive (mode)
  4962.  
  4963.        Parameters:
  4964.         (i) mode     @ON or @OFF.
  4965.  
  4966.        Returns:
  4967.         (i)          previous Exclusive mode.
  4968.  
  4969.        Exclusive(@OFF) is the default mode.  In this mode,the WIL Interpreter
  4970.        is well-behaved toward other Windows applications.
  4971.  
  4972.        Exclusive(@ON) allows WIL programs to run somewhat faster, but causes
  4973.        the WIL Interpreter to be "greedier" about sharing processing time
  4974.        with other active Windows applications.  For the most part, this mode
  4975.        is useful only when you have a series of WIL statements which must be
  4976.        executed in quick succession.
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.        Example:
  4984.         Exclusive(@ON)
  4985.         x = 0
  4986.         start = DateTime()
  4987.         :add
  4988.         x = x + 1
  4989.         If x < 1000 Then Goto add
  4990.         stop = DateTime()
  4991.         crlf = StrCat(Num2Char(13), Num2Char(10))
  4992.         Message("Times", "Start: %start%%crlf%Stop:  %stop%")
  4993.         Exclusive(@OFF)
  4994.  
  4995.  
  4996.        See Also:
  4997.           Yield
  4998.  
  4999.  
  5000.  
  5001.  
  5002.        Execute
  5003.        Executes a statement in a protected environment.  Any errors
  5004.        encountered are recoverable.
  5005.  
  5006.  
  5007.        Syntax:
  5008.         Execute statement
  5009.  
  5010.        Parameters:
  5011.         (s) statement any executable WIL statement.
  5012.  
  5013.        Returns:
  5014.         (not applicable)
  5015.  
  5016.        Use this command to execute computed or user-entered statements.  Due
  5017.        to the built-in error recovery associated with Execute, it is ideal
  5018.        for interactive execution of user-entered commands.
  5019.  
  5020.        Note that the Execute command doesn't operate on a string, per se, but
  5021.        rather on a direct statement.  If you want to put a code segment into
  5022.        a string variable, you must use the substitution feature of the
  5023.        language, as in the example below.
  5024.  
  5025.  
  5026.        Example:
  5027.         cmd = ""
  5028.         cmd = AskLine("WIL Interactive", "Command:", cmd)
  5029.         Execute %cmd%
  5030.  
  5031.  
  5032.        See Also:
  5033.           ErrorMode
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.        Exit
  5043.        Unconditionally ends a WIL program.
  5044.  
  5045.  
  5046.        Syntax:
  5047.         Exit
  5048.  
  5049.        Parameters:
  5050.         (none)
  5051.  
  5052.        Returns:
  5053.         (not applicable)
  5054.  
  5055.        Use this command to immediately terminate a WIL program.  An Exit is
  5056.        implied at the end of each WIL program, and so is not necessary there.
  5057.  
  5058.  
  5059.        Example:
  5060.         a = 100
  5061.         Message("The value of a is", a)
  5062.         Exit
  5063.  
  5064.  
  5065.        See Also:
  5066.           Pause, Return, Terminate
  5067.  
  5068.  
  5069.  
  5070.  
  5071.        FileAppend
  5072.        Appends one or more files to another file.
  5073.  
  5074.  
  5075.        Syntax:
  5076.         FileAppend (source-list, destination)
  5077.  
  5078.        Parameters:
  5079.         (s) source-list    a string containing one or more filenames, which
  5080.                      may be wildcarded.
  5081.         (s) destination    target file name.
  5082.  
  5083.        Returns:
  5084.         (i)          @TRUE if all files were appended successfully;
  5085.                      @FALSE if at least one file wasn't appended.
  5086.  
  5087.        Use this function to append an individual file or a group of files to
  5088.        the end of an existing file.  If destination does not exist, it will
  5089.        be created.
  5090.  
  5091.        The file(s) specified in source-list will not be modified by this
  5092.        function.
  5093.  
  5094.        Source-list may contain * and ? wildcards.  Destination may not
  5095.        contain wildcards of any type; it must be a single file name.
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.        Examples:
  5103.         FileAppend("c:\config.sys", "c:\misc\config.sav")
  5104.  
  5105.         DirChange("c:\batch")
  5106.         FileDelete("allbats.fil")
  5107.         FileAppend("*.bat", "allbats.fil")
  5108.  
  5109.  
  5110.        See Also:
  5111.           FileCopy, FileDelete, FileExist
  5112.  
  5113.  
  5114.  
  5115.  
  5116.        FileAttrGet
  5117.        Returns file attributes.
  5118.  
  5119.  
  5120.        Syntax:
  5121.         FileAttrGet (filename)
  5122.  
  5123.        Parameters:
  5124.         (s) filename file whose attributes you want to determine.
  5125.  
  5126.        Returns:
  5127.         (s)          attribute settings.
  5128.  
  5129.        Returns attributes for the specified file, in a string of the form
  5130.        "RASH".  This string is composed of four individual attribute
  5131.        characters, as follows:
  5132.  
  5133.           Char   Symbol    Meaning
  5134.  
  5135.           1      R    Read-only ON
  5136.           2      A    Archive ON
  5137.           3      S    System ON
  5138.           4      H    Hidden ON
  5139.  
  5140.        A hyphen in any of these positions indicates that the specified
  5141.        attribute is OFF.  For example, the string "-A-H" indicates a file
  5142.        which has the Archive and Hidden attributes set.
  5143.  
  5144.  
  5145.        Example:
  5146.         editfile = "c:\config.sys"
  5147.         attr = FileAttrGet(editfile)
  5148.         If StrSub(attr, 1, 1) == "R" Then Goto readonly
  5149.         Run("notepad.exe", editfile)
  5150.         Exit
  5151.         :readonly
  5152.         Message("File is read-only", "Cannot edit %editfile%")
  5153.  
  5154.  
  5155.        See Also:
  5156.           FileAttrSet, FileTimeGet
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.        FileAttrSet
  5166.        Sets file attributes.
  5167.  
  5168.  
  5169.        Syntax:
  5170.         FileAttrSet (file-list, settings)
  5171.  
  5172.        Parameters:
  5173.         (s) file-list space-delimited list of files.
  5174.         (s) settings new attribute settings for those file(s).
  5175.  
  5176.        Returns:
  5177.         (i)          always 0.
  5178.  
  5179.        The attribute string consists of one or more of the following
  5180.        characters (an upper case letter turns the specified attribute ON, a
  5181.        lower case letter turns it OFF):
  5182.  
  5183.           R read only ON
  5184.           A archive ON
  5185.           S system ON
  5186.           H hidden ON
  5187.  
  5188.           r read only OFF
  5189.           a archive OFF
  5190.           s system OFF
  5191.           h hidden OFF
  5192.  
  5193.  
  5194.        Examples:
  5195.         FileAttrSet("win.ini system.ini", "rAsH")
  5196.  
  5197.         FileAttrSet("c:\command.com", "R")
  5198.  
  5199.  
  5200.        See Also:
  5201.           FileAttrGet, FileTimeTouch
  5202.  
  5203.  
  5204.  
  5205.  
  5206.        FileClose
  5207.        Closes a file.
  5208.  
  5209.  
  5210.        Syntax:
  5211.         FileClose (filehandle)
  5212.  
  5213.        Parameters:
  5214.         (i) filehandle     same integer that was returned by FileOpen.
  5215.  
  5216.        Returns:
  5217.         (i)          always 0.
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.        Example:
  5225.         ; the hard way to copy an ASCII file
  5226.         old = FileOpen("config.sys", "READ")
  5227.         new = FileOpen("sample.txt", "WRITE")
  5228.         :top
  5229.         x = FileRead(old)
  5230.         If x != "*EOF*" Then FileWrite(new, x)
  5231.         If x != "*EOF*" Then Goto top
  5232.         FileClose(new)
  5233.         FileClose(old)
  5234.  
  5235.  
  5236.        See Also:
  5237.           FileOpen, FileRead, FileWrite
  5238.  
  5239.  
  5240.  
  5241.  
  5242.        FileCopy
  5243.        Copies files.
  5244.  
  5245.  
  5246.        Syntax:
  5247.         FileCopy (source-list, destination, warning)
  5248.  
  5249.        Parameters:
  5250.         (s) source-list    a string containing one or more filenames, which
  5251.                      may be wildcarded.
  5252.         (s) destination    target file name.
  5253.         (i) warning  @TRUE if you want a warning before overwriting existing
  5254.                      files;
  5255.                      @FALSE if no warning desired.
  5256.  
  5257.        Returns:
  5258.         (i)          @TRUE if all files were copied successfully;
  5259.                      @FALSE if at least one file wasn't copied.
  5260.  
  5261.        Use this function to copy an individual file, a group of files using
  5262.        wildcards, or several groups of files by separating the names with
  5263.        spaces.
  5264.  
  5265.        You can also copy files to any COM or LPT device.
  5266.  
  5267.        Source-list may contain * and ? wildcards.  Destination may contain
  5268.        the * wildcard only.
  5269.  
  5270.  
  5271.        Examples:
  5272.         FileCopy("c:\config.sys", "d:", @FALSE)
  5273.  
  5274.         FileCopy("c:\*.sys", "d:devices\*.sys", @TRUE)
  5275.  
  5276.         FileCopy("c:\config.sys", "LPT1", @FALSE)
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.        See Also:
  5284.           FileDelete, FileExist, FileLocate, FileMove, FileRename
  5285.  
  5286.  
  5287.  
  5288.  
  5289.        FileDelete
  5290.        Deletes files.
  5291.  
  5292.  
  5293.        Syntax:
  5294.         FileDelete (file-list)
  5295.  
  5296.        Parameters:
  5297.         (s) file-list a string containing one or more filenames, which may be
  5298.                      wildcarded.
  5299.  
  5300.        Returns:
  5301.         (i)          @TRUE if all the files were deleted;
  5302.                      @FALSE if a file didn't exist or is marked with the
  5303.                      READ-ONLY attribute.
  5304.  
  5305.        Use this function to delete an individual file, a group of files using
  5306.        wildcards, or several groups of files by separating the names with
  5307.        spaces.
  5308.  
  5309.  
  5310.        Example:
  5311.         FileDelete("*.bak temp???.fil")
  5312.  
  5313.  
  5314.        See Also:
  5315.           FileExist, FileLocate, FileMove, FileRename
  5316.  
  5317.  
  5318.  
  5319.  
  5320.        FileExist
  5321.        Tests for the existence of files.
  5322.  
  5323.  
  5324.        Syntax:
  5325.         FileExist (filename)
  5326.  
  5327.        Parameters:
  5328.         (s) filename either a fully qualified filename with drive and path,
  5329.                      or just a filename and extension.
  5330.  
  5331.        Returns:
  5332.         (i)          @TRUE if the file exists;
  5333.                      @FALSE if it doesn't exist or if the pathname is
  5334.                      invalid.
  5335.  
  5336.        This function is used to test whether or not a specified file exists.
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.        If a fully-qualified file name is used, only the specified drive and
  5343.        directory will be checked for the desired file.  If only the root and
  5344.        extension are specified, then first the current directory is checked
  5345.        for the file, and then, if the file is not found in the current
  5346.        directory, all directories in the DOS path are searched.
  5347.  
  5348.  
  5349.        Examples:
  5350.         ; check for file in current directory
  5351.         fex = FileExist(StrCat(DirGet(), "myfile.txt"))
  5352.         tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5353.         Message("MyFile.Txt"," Is %tex%in the current directory")
  5354.  
  5355.         ; check for file someplace along path
  5356.         fex = FileExist("myfile.txt")
  5357.         tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5358.         Message("MyFile.Txt", " Is %tex% in the DOS path")
  5359.  
  5360.  
  5361.        See Also:
  5362.           FileLocate
  5363.  
  5364.  
  5365.  
  5366.  
  5367.        FileExtension
  5368.        Returns extension of file.
  5369.  
  5370.  
  5371.        Syntax:
  5372.         FileExtension (filename)
  5373.  
  5374.        Parameters:
  5375.         (s) filename [optional path]full file name, including extension.
  5376.  
  5377.        Returns:
  5378.         (s)          file extension.
  5379.  
  5380.        This function parses the passed filename and returns the extension
  5381.        part of the filename.
  5382.  
  5383.        Example:
  5384.         ; prevent the user from editing a COM or EXE file
  5385.         allfiles = FileItemize("*.*")
  5386.         editfile = ItemSelect("Select file to edit", allfiles, " ")
  5387.         ext = FileExtension(editfile)
  5388.         If (ext == "com") || (ext == "exe") Then Goto noedit
  5389.         run("notepad.exe", editfile)
  5390.         exit
  5391.         :noedit
  5392.         Message ("Sorry", "You may not edit a program file")
  5393.  
  5394.  
  5395.        See Also:
  5396.           DialogBox, FilePath, FileRoot
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.        FileItemize
  5406.        Returns a space-delimited list of files.
  5407.  
  5408.  
  5409.        Syntax:
  5410.         FileItemize (file-list)
  5411.  
  5412.        Parameters:
  5413.         (s) file-list a string containing a list of filenames, which may be
  5414.                      wildcarded.
  5415.  
  5416.        Returns:
  5417.         (s)          space-delimited list of files.
  5418.  
  5419.        This function compiles a list of filenames and separates the names
  5420.        with spaces.
  5421.  
  5422.        This is especially useful in conjunction with the ItemSelect function,
  5423.        which lets the user choose an item from such a space-delimited list.
  5424.  
  5425.        Note: Some shell or file manager applications using the WIL
  5426.        Interpreter allow an empty string ("") to be used as the "file-list"
  5427.        parameter, in which case all files highlighted in the file display are
  5428.        returned.  However, if there are any file names or wildcards in the
  5429.        string, all files matching the file names are returned, regardless of
  5430.        which ones are highlighted.
  5431.  
  5432.  
  5433.        Examples:
  5434.         FileItemize("*.bak")         ;all BAK files
  5435.  
  5436.         FileItemize("*.arc *.zip *.lzh")  ;compressed files
  5437.  
  5438.         ; Get which .INI file to edit
  5439.         ifiles = FileItemize("c:\windows\*.ini")
  5440.         ifile = ItemSelect(".INI Files", ifiles, " ")
  5441.         RunZoom("notepad", ifile)
  5442.         Drop(ifiles, ifile)
  5443.  
  5444.  
  5445.        See Also:
  5446.           CurrentFile, DirItemize, ItemSelect, TextSelect, WinItemize
  5447.  
  5448.  
  5449.  
  5450.  
  5451.        FileLocate
  5452.        Finds file in current directory or along the DOS path.
  5453.  
  5454.  
  5455.        Syntax:
  5456.         FileLocate (filename)
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.        Parameters:
  5464.         (s) filename full file name, including extension.
  5465.  
  5466.        Returns:
  5467.         (s)          fully-qualified path name.
  5468.  
  5469.        This function is used to obtain the fully qualified path name of a
  5470.        file.  The current directory is checked first, and if the file is not
  5471.        found, the DOS path is searched.  The first occurrence of the file is
  5472.        returned.
  5473.  
  5474.  
  5475.        Example:
  5476.         ; Edit WIN.INI
  5477.         winini = FileLocate("win.ini")
  5478.         If winini == "" Then Goto notfound
  5479.         Run("notepad.exe", winini)
  5480.         Exit
  5481.         :notfound
  5482.         Message("???", "WIN.INI not found")
  5483.  
  5484.  
  5485.        See Also:
  5486.           FileExist
  5487.  
  5488.  
  5489.  
  5490.  
  5491.        FileMove
  5492.        Moves files.
  5493.  
  5494.  
  5495.        Syntax:
  5496.         FileMove (source-list, destination, warning)
  5497.  
  5498.        Parameters:
  5499.         (s) source-list    one or more filenames separated by spaces.
  5500.         (s) destination    target filename.
  5501.         (i) warning  @TRUE if you want a warning before overwriting existing
  5502.                      files;
  5503.                      @FALSE if no warning desired.
  5504.  
  5505.        Returns:
  5506.         (i)          @TRUE if the file was moved;
  5507.                      @FALSE if the source file was not found or had the READ-
  5508.                      ONLY attribute, or the target filename is invalid.
  5509.  
  5510.        Use this function to move an individual file, a group of files using
  5511.        wildcards, or several groups of files by separating the names with
  5512.        spaces.
  5513.  
  5514.        You can also move files to another drive, or to any COM or LPT device.
  5515.  
  5516.        Source-list may contain * and ? wildcards.  Destination may contain
  5517.        the * wildcard only.
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.        Examples:
  5525.         FileMove("c:\config.sys", "d:", @FALSE)
  5526.  
  5527.         FileMove("c:\*.sys", "d:*.sys", @TRUE)
  5528.  
  5529.  
  5530.        See Also:
  5531.           FileCopy, FileDelete, FileExist, FileLocate, FileRename
  5532.  
  5533.  
  5534.  
  5535.  
  5536.        FileOpen
  5537.        Opens a STANDARD ASCII (only) file for reading or writing.
  5538.  
  5539.  
  5540.        Syntax:
  5541.         FileOpen (filename, open-type)
  5542.  
  5543.        Parameters:
  5544.         (s) filename name of the file to open.
  5545.         (s) open-type "READ" or "WRITE".
  5546.  
  5547.        Returns:
  5548.         (i)          filehandle
  5549.  
  5550.        The filehandle returned by the FileOpen function may be subsequently
  5551.        used by the FileRead, FileWrite, and FileClose functions.
  5552.  
  5553.  
  5554.        Examples:
  5555.         ; To open for reading:
  5556.         handle = FileOpen("stuff.txt", "READ")
  5557.  
  5558.         ; To open for writing:
  5559.         handle = FileOpen("stuff.txt", "WRITE")
  5560.  
  5561.  
  5562.        See Also:
  5563.           FileClose, FileRead, FileWrite
  5564.  
  5565.  
  5566.  
  5567.  
  5568.        FilePath
  5569.        Returns path of file.
  5570.  
  5571.  
  5572.        Syntax:
  5573.         FilePath (filename)
  5574.  
  5575.        Parameters:
  5576.         (s) filename fully qualified file name, including path.
  5577.  
  5578.        Returns:
  5579.         (s)          fully qualified path name.
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.        FilePath parses the passed filename and returns the drive and path of
  5588.        the file specification, if any.
  5589.  
  5590.        Example:
  5591.         coms = Environment("COMSPEC")
  5592.         compath = FilePath(coms)
  5593.         Message("", "Your command processor is located in %compath%")
  5594.  
  5595.  
  5596.        See Also:
  5597.           FileExtension, FileRoot
  5598.  
  5599.  
  5600.  
  5601.  
  5602.        FileRead
  5603.        Reads data from a file.
  5604.  
  5605.  
  5606.        Syntax:
  5607.         FileRead (filehandle)
  5608.  
  5609.        Parameters:
  5610.         (i) filehandle     same integer that was returned by FileOpen.
  5611.  
  5612.        Returns:
  5613.         (s)          line of data read from file.
  5614.  
  5615.  
  5616.        When the end of the file is reached, the string *EOF* will be
  5617.        returned.
  5618.  
  5619.  
  5620.        Example:
  5621.         handle = FileOpen("autoexec.bat", "READ")
  5622.         :top
  5623.         line = FileRead(handle)
  5624.         Display(4, "AUTOEXEC DATA", line)
  5625.         If line != "*EOF*" Then Goto top
  5626.         FileClose(handle)
  5627.  
  5628.  
  5629.        See Also:
  5630.           FileClose, FileOpen, FileWrite
  5631.  
  5632.  
  5633.  
  5634.  
  5635.        FileRename
  5636.        Renames files.
  5637.  
  5638.  
  5639.        Syntax:
  5640.         FileRename (source-list, destination)
  5641.  
  5642.  
  5643.  
  5644.  
  5645.  
  5646.  
  5647.        Parameters:
  5648.         (s) source-list    one or more filenames, separated by spaces.
  5649.         (s) destination    target filename.
  5650.  
  5651.        Returns:
  5652.         (i)          @TRUE if the file was renamed;
  5653.                      @FALSE if the source file was not found or had the READ-
  5654.                      ONLY attribute, or the target filename is invalid.
  5655.  
  5656.        Use this function to rename an individual file, a group of files using
  5657.        wildcards, or several groups of files by separating the names with
  5658.        spaces.
  5659.  
  5660.        Note: Unlike FileMove, you cannot make a file change its resident disk
  5661.        drive with FileRename.
  5662.  
  5663.        Source-list may contain * and ? wildcards.  Destination may contain
  5664.        the * wildcard only.
  5665.  
  5666.  
  5667.        Examples:
  5668.         FileRename("c:\config.sys", "config.old")
  5669.  
  5670.         FileRename("c:\*.txt", "*.bak")
  5671.  
  5672.  
  5673.        See Also:
  5674.           FileCopy, FileExist, FileLocate, FileMove
  5675.  
  5676.  
  5677.  
  5678.  
  5679.        FileRoot
  5680.        Returns root of file.
  5681.  
  5682.  
  5683.        Syntax:
  5684.         FileRoot (filename)
  5685.  
  5686.        Parameters:
  5687.         (s) filename [optional path]full file name, including extension.
  5688.  
  5689.        Returns:
  5690.         (s)          file root.
  5691.  
  5692.  
  5693.        FileRoot parses the passed filename and returns the root part of the
  5694.        filename.
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.        Example:
  5702.         allfiles = FileItemize("*.*")
  5703.         editfile = ItemSelect("Select file to edit", allfiles, " ")
  5704.         root = FileRoot(editfile)
  5705.         ext = FileExtension(editfile)
  5706.         lowerext = StrLower(ext)
  5707.         nicefile = StrCat(root, ".", lowerext)
  5708.         Message("", "You are about to edit %nicefile%.")
  5709.         Run("notepad.exe", editfile)
  5710.  
  5711.  
  5712.        See Also:
  5713.           FileExtension, FilePath
  5714.  
  5715.  
  5716.  
  5717.  
  5718.        FileSize
  5719.        Finds the total size of a group of files.
  5720.  
  5721.  
  5722.        Syntax:
  5723.         FileSize (file-list)
  5724.  
  5725.        Parameters:
  5726.         (s) file-list zero or more filenames, separated by spaces.
  5727.  
  5728.        Returns:
  5729.         (i)          total bytes taken up by the specified file(s).
  5730.  
  5731.        This function returns the total size of the specified files.  Note
  5732.        that it doesn't handle wildcarded filenames.  You can, however, use
  5733.        FileItemize on a wildcarded filename and use the resulting string as a
  5734.        FileSize parameter.
  5735.  
  5736.  
  5737.        Example:
  5738.         size = FileSize(FileItemize("*.*"))
  5739.         Message("Size of All Files in Directory", size)
  5740.  
  5741.  
  5742.        See Also:
  5743.           DiskFree
  5744.  
  5745.  
  5746.  
  5747.  
  5748.        FileTimeGet
  5749.        Returns file date and time.
  5750.  
  5751.  
  5752.        Syntax:
  5753.         FileTimeGet (filename)
  5754.  
  5755.        Parameters:
  5756.         (s) filename name of file for which you want the date and time.
  5757.  
  5758.  
  5759.  
  5760.  
  5761.  
  5762.  
  5763.        Returns:
  5764.         (s)          file date and time.
  5765.  
  5766.        This function will return the date and time of a file, in a pre-
  5767.        formatted string.  The format it is returned in depends on the date
  5768.        format specified in the [Intl] section of the WIN.INI file:
  5769.  
  5770.        mm/dd/yy  hh:mmXX
  5771.        dd/mm/yy  hh:mmXX
  5772.        yy/mm/dd  hh:mmXX
  5773.  
  5774.        Where:
  5775.           mm  is the month (e.g. 10)
  5776.           dd  is the day of the month (e.g. 23)
  5777.           yy  is the year (e.g. 90)
  5778.           hh  is the hours
  5779.           mm  is the minutes
  5780.           XX  is the Day/Night code (e.g. AM or PM)
  5781.  
  5782.        There are two spaces between the date and the time.
  5783.  
  5784.        The WIN.INI file will be examined to determine which format to use.
  5785.        You can adjust the WIN.INI file via the International section of
  5786.        Control Panel if the format isn't what you prefer.
  5787.  
  5788.  
  5789.        Example:
  5790.         oldtime = FileTimeGet("win.ini")
  5791.         Run("notepad.exe", "win.ini")
  5792.         WinWaitClose("Notepad - WIN.INI")
  5793.         newtime = FileTimeGet("win.ini")
  5794.         If StrCmp(oldtime, newtime) == 0 Then Exit
  5795.         Message("", "WIN.INI has been changed")
  5796.  
  5797.  
  5798.        See Also:
  5799.           DateTime, FileAttrGet, FileTimeTouch
  5800.  
  5801.  
  5802.  
  5803.  
  5804.        FileTimeTouch
  5805.        Sets file(s) to current time.
  5806.  
  5807.  
  5808.        Syntax:
  5809.         FileTimeTouch (file-list)
  5810.  
  5811.        Parameters:
  5812.         (s) file-list a space-delimited list of files
  5813.  
  5814.        Returns:
  5815.         (i)          always 0
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.        File-list is a space-delimited list of files, which may not contain
  5822.        wildcards.  The path is searched if the file is not found in current
  5823.        directory and if the directory is not specified in file-list.
  5824.  
  5825.  
  5826.        Example:
  5827.         FileTimeTouch("wac.c wac.rc")
  5828.         Run("make.exe", "-fwac.mak")
  5829.  
  5830.  
  5831.        See Also:
  5832.           FileAttrSet, FileTimeGet
  5833.  
  5834.  
  5835.  
  5836.  
  5837.        FileWrite
  5838.        Writes data to a file.
  5839.  
  5840.  
  5841.        Syntax:
  5842.         FileWrite (filehandle, output-data)
  5843.  
  5844.        Parameters:
  5845.         (i) filehandle     same integer that was returned by FileOpen.
  5846.         (s) output-data    data to write to file.
  5847.  
  5848.        Returns:
  5849.         (i)          always 0.
  5850.  
  5851.  
  5852.  
  5853.        Example:
  5854.         handle = FileOpen("stuff.txt", "WRITE")
  5855.         FileWrite(handle, "Gobbledygook")
  5856.         FileClose(handle)
  5857.  
  5858.  
  5859.        See Also:
  5860.           FileClose, FileOpen, FileRead
  5861.  
  5862.  
  5863.  
  5864.  
  5865.        Goto
  5866.        Changes the flow of control in a WIL program.
  5867.  
  5868.  
  5869.        Syntax:
  5870.         Goto label
  5871.  
  5872.        Parameters:
  5873.         (s) label    user-defined identifier.
  5874.  
  5875.        Goto label causes an unconditional branch to the line in the program
  5876.        marked :label, where the identifier is preceded by a colon (:).
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.        Example:
  5884.         If WinExist("Solitaire") == @FALSE Then Goto open
  5885.         WinActivate("Solitaire")
  5886.         Goto loaded
  5887.         :open
  5888.         Run("sol.exe", "")
  5889.         :loaded
  5890.  
  5891.  
  5892.        See Also:
  5893.           Else, If ... Then, Then
  5894.  
  5895.  
  5896.  
  5897.  
  5898.        IconArrange
  5899.        Rearranges icons.
  5900.  
  5901.  
  5902.        Syntax:
  5903.         IconArrange ( )
  5904.  
  5905.        Parameters:
  5906.         (none)
  5907.  
  5908.        Returns:
  5909.         (i)          always 0.
  5910.  
  5911.        This function rearranges the icons at the bottom of the screen,
  5912.        spacing them evenly.  It does not change the order in which the icons
  5913.        appear.
  5914.  
  5915.  
  5916.        Example:
  5917.         IconArrange ( )
  5918.  
  5919.  
  5920.        See Also:
  5921.           RunIcon, WinArrange, WinIconize, WinPlaceSet
  5922.  
  5923.  
  5924.  
  5925.  
  5926.        If...Then
  5927.        Conditionally performs a function.
  5928.  
  5929.  
  5930.        Syntax:
  5931.         If condition Then statement
  5932.  
  5933.        Parameters:
  5934.         (s) condition an expression to be evaluated.
  5935.         (s) statement any valid WIL function or command.
  5936.  
  5937.        If the condition following the If keyword is true, the statement
  5938.        following the Then keyword is executed.  If the condition following
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.        the If keyword is false, the statement following the Then keyword is
  5945.        ignored.
  5946.  
  5947.        See the Else and Then commands for additional flexibility in
  5948.        conditional processing.
  5949.  
  5950.  
  5951.        Example:
  5952.         sure = AskYesNo("End Session", "Really quit Windows?")
  5953.         If sure == @YES Then EndSession()
  5954.  
  5955.  
  5956.        See Also:
  5957.           Else, Goto, Then
  5958.  
  5959.  
  5960.  
  5961.  
  5962.        IgnoreInput
  5963.        Turns off hardware input to windows.
  5964.  
  5965.  
  5966.        Syntax:
  5967.         IgnoreInput (mode)
  5968.  
  5969.        Parameters:
  5970.         (i) mode     @TRUE or @FALSE.
  5971.  
  5972.        Returns:
  5973.         (i)          previous IgnoreInput mode.
  5974.  
  5975.  
  5976.        IgnoreInput causes mouse movements, clicks and keyboard entry to be
  5977.        completely ignored.  Good for self-running demos.
  5978.  
  5979.        Warning: If you are not careful with the use of IgnoreInput, you can
  5980.        lock up your computer!
  5981.  
  5982.  
  5983.        Example:
  5984.         username = AskLine("Hello", "Please enter your name","")
  5985.         IgnoreInput(@TRUE)
  5986.         Call("demo.wbt", username)
  5987.         IgnoreInput(@FALSE)
  5988.  
  5989.  
  5990.        See Also:
  5991.           WaitForKey
  5992.  
  5993.  
  5994.  
  5995.  
  5996.        IniDelete
  5997.        Removes a line or section from WIN.INI.
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.        Syntax:
  6005.         IniDelete (section, keyname)
  6006.  
  6007.        Parameters:
  6008.         (s) section  the major heading under which the item is located.
  6009.         (s) keyname  the name of the item to delete.
  6010.  
  6011.        Returns:
  6012.         (i)          always 0
  6013.  
  6014.        This function will remove the specified line from the specified
  6015.        section in WIN.INI.  You can remove an entire section, instead of just
  6016.        a single line, by specifying a keyword of @WHOLESECTION.  Case is not
  6017.        significant in section or keyname.
  6018.  
  6019.  
  6020.        Examples:
  6021.         IniDelete("Desktop", "Wallpaper")
  6022.  
  6023.         IniDelete("Quicken",@WHOLESECTION)
  6024.  
  6025.  
  6026.        See Also:
  6027.           IniDeletePvt, IniItemize, IniRead, IniWrite
  6028.  
  6029.  
  6030.  
  6031.  
  6032.        IniDeletePvt
  6033.        Removes a line or section from a private INI file.
  6034.  
  6035.  
  6036.        Syntax:
  6037.         IniDeletePvt (section, keyname, filename)
  6038.  
  6039.        Parameters:
  6040.         (s) section  the major heading under which the item is located.
  6041.         (s) keyname  the name of the item to delete.
  6042.         (s) filename name of the INI file.
  6043.  
  6044.        Returns:
  6045.         (i)          always 0.
  6046.  
  6047.        This function will remove the specified line from the specified
  6048.        section in a private INI file.  You can remove an entire section,
  6049.        instead of just a single line, by specifying a keyword of
  6050.        @WHOLESECTION.  Case is not significant in section or keyname.
  6051.  
  6052.  
  6053.        Example:
  6054.         IniDeletePvt("Current Users", "Excel", "meter.ini")
  6055.  
  6056.  
  6057.        See Also:
  6058.           IniDelete, IniItemizePvt, IniReadPvt, IniWritePvt
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.        IniItemize
  6068.        Lists keywords or sections in WIN.INI.
  6069.  
  6070.  
  6071.        Syntax:
  6072.         IniItemize (section)
  6073.  
  6074.        Parameters:
  6075.         (s) section  the major heading to itemize.
  6076.  
  6077.        Returns:
  6078.         (s)          list of keywords or sections.
  6079.  
  6080.        IniItemize will scan the specified section in WIN.INI, and return a
  6081.        tab-delimited list of all keyword names contained within that section.
  6082.        If a null string ("") is given as the section name, IniItemize will
  6083.        return a list of all section names contained within WIN.INI.  Returns
  6084.        "(None)" if the specified section does not exist; returns a null
  6085.        string ("") if the section exists but is empty.  Case is not
  6086.        significant in section names.
  6087.  
  6088.  
  6089.        Examples:
  6090.         ; Returns all keywords in the [Extensions] section
  6091.         keywords = IniItemize("Extensions")
  6092.  
  6093.         ; Returns all sections in the entire WIN.INI file
  6094.         sections = IniItemize("")
  6095.  
  6096.  
  6097.        See Also:
  6098.           IniDelete, IniItemizePvt, IniRead, IniWrite
  6099.  
  6100.  
  6101.  
  6102.  
  6103.        IniItemizePvt
  6104.        Lists keywords or sections in a private INI file.
  6105.  
  6106.  
  6107.        Syntax:
  6108.         IniItemizePvt (section, filename)
  6109.  
  6110.        Parameters:
  6111.         (s) section  the major heading to itemize.
  6112.         (s) filename name of the INI file.
  6113.  
  6114.        Returns:
  6115.         (s)          list of keywords or sections.
  6116.  
  6117.        IniItemizePvt will scan the specified section in a private INI file,
  6118.        and return a tab-delimited list of all keyword names contained within
  6119.        that section.  If a null string ("") is given as the section name,
  6120.        IniItemizePvt will return a list of all section names contained within
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.        the file.  Returns "(None)" if the specified section does not exist;
  6127.        returns a null string ("") if the section exists but is empty.  Case
  6128.        is not significant in section names.
  6129.  
  6130.  
  6131.        Example:
  6132.         ; Returns all keywords in the [Boot] section of SYSTEM.INI
  6133.         keywords = IniItemizePvt("Boot", "system.ini")
  6134.  
  6135.  
  6136.        See Also:
  6137.           IniDeletePvt, IniItemize, IniReadPvt, IniWritePvt
  6138.  
  6139.  
  6140.  
  6141.  
  6142.        IniRead
  6143.        Reads data from the WIN.INI file.
  6144.  
  6145.  
  6146.        Syntax:
  6147.         IniRead (section, keyname, default)
  6148.  
  6149.        Parameters:
  6150.         (s) section  the major heading to read the data from.
  6151.         (s) keyname  the name of the item to read.
  6152.         (s) default  string to return if the desired item is not found.
  6153.  
  6154.        Returns:
  6155.         (s)          data from WIN.INI file.
  6156.  
  6157.        This function allows a program to read data from the WIN.INI file.
  6158.  
  6159.        The WIN.INI file has the form:
  6160.  
  6161.           [section]
  6162.           keyname=settings
  6163.  
  6164.  
  6165.        Most of the entries in WIN.INI are set from the Windows Control Panel
  6166.        program, but individual applications can also use it to store option
  6167.        settings in their own sections.
  6168.  
  6169.  
  6170.        Example:
  6171.         ; Find the default output device
  6172.         a = IniRead("windows", "device", "No Default")
  6173.         Message("Default Output Device", a)
  6174.  
  6175.  
  6176.        See Also:
  6177.           Environment, IniDelete, IniItemize, IniReadPvt, IniWrite
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.        IniReadPvt
  6187.        Reads data from a private INI file.
  6188.  
  6189.  
  6190.        Syntax:
  6191.         IniReadPvt (section, keyname, default, filename)
  6192.  
  6193.        Parameters:
  6194.         (s) section  the major heading to read the data from.
  6195.         (s) keyname  the name of the item to read.
  6196.         (s) default  string to return if the desired item is not found.
  6197.         (s) filename name of the INI file.
  6198.  
  6199.        Returns:
  6200.         (s)          data from the INI file.
  6201.  
  6202.        Looks up a value in the "filename".INI file.  If the value is not
  6203.        found, the "default" will be returned.
  6204.  
  6205.  
  6206.        Example:
  6207.         IniReadPvt("Main", "Lang", "English", "WB.INI")
  6208.  
  6209.        Given the following segment from WB.INI:
  6210.  
  6211.           [Main]
  6212.           Lang=French
  6213.  
  6214.        The statement above would return:
  6215.  
  6216.           French
  6217.  
  6218.  
  6219.        See Also:
  6220.           Environment, IniDeletePvt, IniItemizePvt, IniRead, IniWritePvt
  6221.  
  6222.  
  6223.  
  6224.  
  6225.        IniWrite
  6226.        Writes data to the WIN.INI file.
  6227.  
  6228.  
  6229.        Syntax:
  6230.         IniWrite (section, keyname, data)
  6231.  
  6232.        Parameters:
  6233.         (s) section  major heading to write the data to.
  6234.         (s) keyname  name of the data item to write.
  6235.         (s) data     string to write to the WIN.INI file.
  6236.  
  6237.        Returns:
  6238.         (i)          always 1.
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.        This command allows a program to write data to the WIN.INI file.  The
  6245.        "section" is added to the file if it doesn't already exist.
  6246.  
  6247.  
  6248.        Example:
  6249.         ; Change the list of pgms to load upon Windows
  6250.         ; startup
  6251.         loadprogs = IniRead("windows", "load", "")
  6252.         newprogs = AskLine("Add Pgm To LOAD= Line", "Add:", loadprogs)
  6253.         IniWrite("windows", "load", newprogs)
  6254.  
  6255.  
  6256.        See Also:
  6257.           IniDelete, IniItemize, IniRead, IniWritePvt
  6258.  
  6259.  
  6260.  
  6261.  
  6262.        IniWritePvt
  6263.        Writes data to a private INI file.
  6264.  
  6265.  
  6266.        Syntax:
  6267.         IniWritePvt (section, keyname, data, filename)
  6268.  
  6269.        Parameters:
  6270.         (s) section  major heading to write the data to.
  6271.         (s) keyname  name of the data item to write.
  6272.         (s) data     string to write to the INI file.
  6273.         (s) filename name of the INI file.
  6274.  
  6275.        Returns:
  6276.         (i)          always 1.
  6277.  
  6278.        Writes a value in the "filename".INI file.
  6279.  
  6280.  
  6281.        Example:
  6282.         IniWritePvt("Main", "Lang", "French, "WB.INI")
  6283.  
  6284.        This would create the following entry in WB.INI:
  6285.  
  6286.           [Main]
  6287.           Lang=French
  6288.  
  6289.  
  6290.        See Also:
  6291.           IniDeletePvt, IniItemizePvt, IniReadPvt, IniWrite
  6292.  
  6293.  
  6294.  
  6295.  
  6296.        IntControl
  6297.        Internal control functions.
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.  
  6304.        Syntax:
  6305.         IntControl (request#, p1, p2, p3, p4)
  6306.  
  6307.        Parameters:
  6308.         (i) request# specifies which sub-function is to be performed (see
  6309.                      below).
  6310.         (s) p1 - p4  parameters which may be required by the function (see
  6311.                      below).
  6312.  
  6313.        Returns:
  6314.         (s)          varies (see below).
  6315.  
  6316.        Short for Internal Control, a special function that permits numerous
  6317.        internal operations in the various products.  The first parameter of
  6318.        IntControl defines exactly what the function does, the other
  6319.        parameters are possible arguments to the function.
  6320.  
  6321.        Refer to your product documentation for any further information on
  6322.        this function.
  6323.  
  6324.        Warning: Many of these operations are useful only under special
  6325.        circumstances, and/or by technically knowledgeable users.  Some could
  6326.        lead to adverse side effects.  If it isn't clear to you what a
  6327.        particular function does, don't use it.
  6328.  
  6329.  
  6330.        IntControl (1, p1, 0, 0, 0)
  6331.        Just a test IntControl.  It echoes back P1 & P2 and P3 & P4 in a pair
  6332.        of message boxes.
  6333.  
  6334.  
  6335.        IntControl (4, p1, 0, 0, 0)
  6336.        Controls whether or not a dialog box with a file listbox in it has to
  6337.        return a file name, or may return merely a directory name or nothing.
  6338.  
  6339.           P1   Meaning
  6340.  
  6341.           0    May return nothing, or just a directory name
  6342.           1    Must return a file name (default)
  6343.  
  6344.  
  6345.        IntControl (5, p1, 0, 0, 0)
  6346.        Controls whether system & hidden files are seen and processed.
  6347.  
  6348.           P1   Meaning
  6349.  
  6350.           0    System & Hidden files not used (default)
  6351.           1    System & Hidden files seen and used
  6352.  
  6353.  
  6354.        IntControl (10, p1, 0, 0, 0)
  6355.        Interrogates the Command Extender DLL status
  6356.  
  6357.           P1   Meaning
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.           0    Command Extender present
  6364.                0     No
  6365.                1     Yes
  6366.  
  6367.           1    Command Extender version
  6368.                -1    No Extender present
  6369.                0     Incompatible extender present
  6370.                (other)Extender version code
  6371.  
  6372.           2    Interpreter's Extender interface code
  6373.  
  6374.           3    Name of Extender DLL
  6375.  
  6376.  
  6377.        IntControl (20, 0, 0, 0, 0)
  6378.        Returns window handle of current parent window.
  6379.  
  6380.  
  6381.        IntControl (21, p1, 0, 0, 0)
  6382.        Returns window handle of window matching the partial window-name in
  6383.        p1.
  6384.  
  6385.  
  6386.        IntControl (22, p1, p2, p3, p4)
  6387.        Issues a Windows "SendMessage".
  6388.  
  6389.           p1   Window handle to send to
  6390.           p2   Message ID number (in decimal)
  6391.           p3   wParam value
  6392.           p4   assumed to be a character string.  String is copied to a 
  6393.                GMEM_LOWER buffer, and a LPSTR to the copied string is passed 
  6394.                as lParam. The GMEM_LOWER buffer is freed immediately upon 
  6395.                return from the SendMessage
  6396.  
  6397.  
  6398.        IntControl (23, 0, 0, 0, 0)
  6399.        Issues a windows PostMessage
  6400.  
  6401.           p1   Window handle
  6402.           p2   Message ID number (in decimal)
  6403.           p3   wParam
  6404.           p4   lParam -- assumed to be numeric
  6405.  
  6406.  
  6407.        IntControl (66, 0, 0, 0, 0)
  6408.        Restarts Windows, just like exiting to DOS and typing WIN again.
  6409.        Could be used to restart Windows after editing the SYSTEM.INI file to
  6410.        change video modes.
  6411.  
  6412.  
  6413.        IntControl (67, 0, 0, 0, 0)
  6414.        Performs a warm boot of the system, just like <Ctrl-Alt-Del>.  Could
  6415.        be used to reboot the system after editing the AUTOEXEC.BAT or
  6416.        CONFIG.SYS files.
  6417.  
  6418.        Note: IntControl(67) requires Windows 3.1 or higher.  Under Windows
  6419.        3.0, it behaves just like IntControl(66) and restarts Windows.
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.        IsDefined
  6429.        Determines if a variable name is currently defined.
  6430.  
  6431.  
  6432.        Syntax:
  6433.         IsDefined (var)
  6434.  
  6435.        Parameters:
  6436.         (s) var      a variable name.
  6437.  
  6438.        Returns:
  6439.         (i)          @YES if the variable is currently defined;
  6440.                      @NO if it was never defined or has been dropped.
  6441.  
  6442.        A variable is defined the first time it appears to the left of an
  6443.        equal sign in a statement.  It stays defined until it is explicitly
  6444.        dropped with the Drop function, or until the current invocation of the
  6445.        WIL Interpreter gets closed.
  6446.  
  6447.  
  6448.        Example:
  6449.         def = IsDefined(thisvar)
  6450.         If def == @FALSE Then Message("ERROR!", "Variable not defined")
  6451.  
  6452.  
  6453.        See Also:
  6454.           Drop
  6455.  
  6456.  
  6457.  
  6458.  
  6459.        IsKeyDown
  6460.        Tells about keys/mouse.
  6461.  
  6462.        Syntax:
  6463.         IsKeyDown(keycodes)
  6464.  
  6465.        Parameters:
  6466.         (i) keycodes @SHIFT and/or @CTRL.
  6467.  
  6468.        Returns:
  6469.         (i)          @YES if the key is down;
  6470.                      @NO if the key is not down.
  6471.  
  6472.  
  6473.        Determines if the Shift key or the Ctrl key is currently down.
  6474.  
  6475.        Note: The right mouse button is the same as Shift, and the middle
  6476.        mouse button is the same as Ctrl.
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.        Examples:
  6484.         IsKeyDown(@SHIFT)
  6485.  
  6486.         IsKeyDown(@CTRL)
  6487.  
  6488.         IsKeyDown(@CTRL | @SHIFT)
  6489.  
  6490.         IsKeyDown(@CTRL & @SHIFT)
  6491.  
  6492.  
  6493.        See Also:
  6494.           WaitForKey
  6495.  
  6496.  
  6497.  
  6498.  
  6499.        IsLicensed
  6500.        Tells if the calling application is licensed.
  6501.  
  6502.  
  6503.        Syntax:
  6504.         IsLicensed ( )
  6505.  
  6506.        Parameters:
  6507.         (none)
  6508.  
  6509.        Returns:
  6510.         (i)          @YES if it is licensed;
  6511.                      @NO if it is not licensed.
  6512.  
  6513.  
  6514.        Returns information on whether or not the currently-running version of
  6515.        the calling application is a licensed copy.
  6516.  
  6517.  
  6518.        Example:
  6519.         IsLicensed()
  6520.  
  6521.  
  6522.        See Also:
  6523.           Version
  6524.  
  6525.  
  6526.  
  6527.  
  6528.        IsMenuChecked [*M]
  6529.        Determines if a menu item has a checkmark next to it.
  6530.  
  6531.  
  6532.        Syntax:
  6533.         IsMenuChecked (menuname)
  6534.  
  6535.        Parameters:
  6536.         (s) menuname name of the menu item to test.
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.        Returns:
  6544.         (i)          @YES if the menu item has a checkmark;
  6545.                      @NO if it doesn't.
  6546.  
  6547.        You can place a checkmark next to a menu item with the MenuChange
  6548.        command, to indicate an option has been enabled.  This function lets
  6549.        you determine if the menu item has already been checked or not.
  6550.  
  6551.        Note: This command is not part of the WIL Interpreter package, but is
  6552.        documented here because it has been implemented in many of the shell
  6553.        or file manager-type applications which use the WIL Interpreter.
  6554.  
  6555.  
  6556.        Example:
  6557.         ; assume we've defined a "Misc | Prompt Often" menu item
  6558.         prompt = IsMenuChecked("MiscPromptOften")
  6559.         ifprompt = SubStr(";", 1, (prompt == @FALSE))
  6560.         Execute %ifprompt% confirm = AskYesNo("???", "REALLY do this?")
  6561.         ; some risky operation the user has just confirmed they want to do
  6562.         Execute %ifprompt% Terminate(confirm != @YES, "", "")
  6563.  
  6564.  
  6565.        See Also:
  6566.           IsMenuEnabled, MenuChange
  6567.  
  6568.  
  6569.  
  6570.  
  6571.        IsMenuEnabled [*M]
  6572.        Determines if a menu item has been enabled.
  6573.  
  6574.  
  6575.        Syntax:
  6576.         IsMenuEnabled (menuname)
  6577.  
  6578.        Parameters:
  6579.         (s) menuname name of the menu item to test.
  6580.  
  6581.        Returns:
  6582.         (i)          @YES if the menu item is enabled;
  6583.                      @NO if it is disabled & grayed.
  6584.  
  6585.        You can disable a menu item with the MenuChange command if you want to
  6586.        prevent the user from choosing it.  It shows up on the screen as a
  6587.        grayed item.  IsMenuEnabled lets you determine if the menu item is
  6588.        currently enabled or not.
  6589.  
  6590.        Note: This command is not part of the WIL Interpreter package, but is
  6591.        documented here because it has been implemented in many of the shell
  6592.        or file manager-type applications which use the WIL Interpreter.
  6593.  
  6594.  
  6595.        Example:
  6596.         ; allow editing of autoexec.bat file only if choice enabled
  6597.         Terminate(!IsMenuEnabled("UtilitiesEditBatFile"), "", "")
  6598.         Run("notepad.exe", "c:\autoexec.bat")
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.        See Also:
  6607.           IsMenuChecked, MenuChange
  6608.  
  6609.  
  6610.  
  6611.  
  6612.        IsNumber
  6613.        Determines whether a variable contains a valid number.
  6614.  
  6615.  
  6616.        Syntax:
  6617.         IsNumber (string)
  6618.  
  6619.        Parameters:
  6620.         (s) string   string to test to see if it represents a valid number.
  6621.  
  6622.        Returns:
  6623.         (i)          @YES if it contains a valid number;
  6624.                      @NO if it doesn't.
  6625.  
  6626.        This function determines if a string variable contains a valid
  6627.        integer.  Useful for checking user input prior to using it in
  6628.        computations.
  6629.  
  6630.  
  6631.        Example:
  6632.         a = AskLine("ISNUMBER", "Enter a number", "0")
  6633.         If IsNumber(a) == @NO Then Message("", "You didn't enter a 
  6634.             number")
  6635.  
  6636.  
  6637.        See Also:
  6638.           Abs, Char2Num, Num2Char
  6639.  
  6640.  
  6641.  
  6642.  
  6643.        ItemCount
  6644.        Returns the number of items in a list.
  6645.  
  6646.  
  6647.        Syntax:
  6648.         ItemCount (list, delimiter)
  6649.  
  6650.        Parameters:
  6651.         (s) list     a string containing a list of items.
  6652.         (s) delimiter a character to act as a delimiter between items in the
  6653.                      list.
  6654.  
  6655.        Returns:
  6656.         (i)          the number of items in the list.
  6657.  
  6658.        If you create the list with the FileItemize or DirItemize functions
  6659.        you will be using a space-delimited list.  WinItemize, however,
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.        creates a tab-delimited list of window titles since titles can have
  6666.        embedded blanks.
  6667.  
  6668.  
  6669.        Example:
  6670.         a = FileItemize("*.*")
  6671.         n = ItemCount(a, " ")
  6672.         Message("Note", "There are %n% files")
  6673.  
  6674.  
  6675.        See Also:
  6676.           ItemExtract, ItemSelect
  6677.  
  6678.  
  6679.  
  6680.  
  6681.        ItemExtract
  6682.        Returns the selected item from a list.
  6683.  
  6684.  
  6685.        Syntax:
  6686.         ItemExtract (index, list, delimiter)
  6687.  
  6688.        Parameters:
  6689.         (i) index    the position in list of the item to be selected.
  6690.         (s) list     a string containing a list of items.
  6691.         (s) delimiter a character to act as a delimiter between items in the
  6692.                      list.
  6693.  
  6694.        Returns:
  6695.         (s)          the selected item.
  6696.  
  6697.        If you create the list with the FileItemize or DirItemize functions
  6698.        you will be using a space-delimited list.  WinItemize, however,
  6699.        creates a tab-delimited list of window titles since titles can have
  6700.        embedded blanks.
  6701.  
  6702.  
  6703.        Example:
  6704.         bmpfiles = FileItemize("*.bmp")
  6705.         bmpcount = ItemCount(bmpfiles, " ")
  6706.         pos = (Random(bmpcount - 1)) + 1
  6707.         paper = ItemExtract(pos, bmpfiles, " ")
  6708.         Wallpaper(paper, @FALSE)
  6709.  
  6710.  
  6711.        See Also:
  6712.           ItemCount, ItemLocate, ItemSelect, ItemSort
  6713.  
  6714.  
  6715.  
  6716.  
  6717.        ItemInsert
  6718.        Adds an item to a list.
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.        Syntax:
  6726.         ItemInsert (item, index, list, delimiter)
  6727.  
  6728.        Parameters:
  6729.         (s) item     a new item to add to list.
  6730.         (i) index    the position in list after which the item will be
  6731.                      inserted.
  6732.         (s) list     a string containing a list of items.
  6733.         (s) delimiter a character to act as a delimiter between items in the
  6734.                      list.
  6735.  
  6736.        Returns:
  6737.         (s)          new list, with item inserted.
  6738.  
  6739.        This function inserts a new item into an existing list, at the
  6740.        position following index.  It returns a new list, with the specified
  6741.        item inserted; the original list (list) is unchanged.  For example,
  6742.        specifying an index of 1 causes the new item to be inserted after the
  6743.        first item in the list; i.e., the new item becomes the second item in
  6744.        the list.
  6745.  
  6746.        You can specify an index of 0 to add the item to the beginning of the
  6747.        list, and an index of -1 to append the item to the end of the list.
  6748.  
  6749.        If you create the list with the FileItemize or DirItemize functions
  6750.        you will be using a space-delimited list.  WinItemize, however,
  6751.        creates a tab-delimited list of window titles since titles can have
  6752.        embedded blanks.
  6753.  
  6754.  
  6755.        Example:
  6756.         newlist = ItemInsert(item, index, list, delimiter)
  6757.  
  6758.  
  6759.        See Also:
  6760.           ItemCount, ItemRemove
  6761.  
  6762.  
  6763.  
  6764.  
  6765.        ItemLocate
  6766.        Returns the position of an item in a list.
  6767.  
  6768.  
  6769.        Syntax:
  6770.         ItemLocate (item, list, delimiter)
  6771.  
  6772.        Parameters:
  6773.         (s) item     item to search for in list.
  6774.         (s) list     a string containing a list of items.
  6775.         (s) delimiter a character to act as a delimiter between items in the
  6776.                      list.
  6777.  
  6778.        Returns:
  6779.         (i)          position in list of item, or 0 if no match found.
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.        This function finds the first occurrence of item in the specified
  6786.        list, and returns the position of the item (the first item in a list
  6787.        has a position of 1).  If the item is not found, the function will
  6788.        return a 0.
  6789.  
  6790.        If you create the list with the FileItemize or DirItemize functions
  6791.        you will be using a space-delimited list.  WinItemize, however,
  6792.        creates a tab-delimited list of window titles since titles can have
  6793.        embedded blanks.
  6794.  
  6795.  
  6796.        Example:
  6797.         ItemLocate(item, list, delimiter)
  6798.  
  6799.  
  6800.        See Also:
  6801.           ItemExtract
  6802.  
  6803.  
  6804.  
  6805.  
  6806.        ItemRemove
  6807.        Removes an item from a list.
  6808.  
  6809.  
  6810.        Syntax:
  6811.         ItemRemove (index, list, delimiter)
  6812.  
  6813.        Parameters:
  6814.         (i) index    the position in list of the item to be removed.
  6815.         (s) list     a string containing a list of items.
  6816.         (s) delimiter a character to act as a delimiter between items in the
  6817.                      list.
  6818.  
  6819.        Returns:
  6820.         (s)          new list, with item removed.
  6821.  
  6822.        This function removes the item at the position specified by index from
  6823.        a list.  The delimiter following the item is removed as well.  It
  6824.        returns a new list, with the specified item removed; the original list
  6825.        (list) is unchanged.
  6826.  
  6827.        If you create the list with the FileItemize or DirItemize functions
  6828.        you will be using a space-delimited list.  WinItemize, however,
  6829.        creates a tab-delimited list of window titles since titles can have
  6830.        embedded blanks.
  6831.  
  6832.  
  6833.        Example:
  6834.         newlist = ItemRemove(index, list, delimiter)
  6835.  
  6836.  
  6837.        See Also:
  6838.           ItemCount, ItemInsert
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.        ItemSelect
  6848.        Allows the user to choose an item from a listbox.
  6849.  
  6850.  
  6851.        Syntax:
  6852.         ItemSelect (title, list, delimiter)
  6853.  
  6854.        Parameters:
  6855.         (s) title    the title of the dialog box to display.
  6856.         (s) list     a string containing a list of items.
  6857.         (s) delimiter a character to act as a delimiter between items in the
  6858.                      list.
  6859.  
  6860.        Returns:
  6861.         (s)          the selected item.
  6862.  
  6863.        This function displays a dialog box with a listbox inside.  This
  6864.        listbox is filled with a sorted list of items taken from a string you
  6865.        provide to the function.
  6866.  
  6867.        Each item in the string must be separated ("delimited") by a
  6868.        character, which you also pass to the function.
  6869.  
  6870.        The user selects one of the items by either doubleclicking on it, or
  6871.        single-clicking and pressing OK.  The item is returned as a string.
  6872.  
  6873.        If you create the list with the FileItemize or DirItemize functions
  6874.        you will be using a space-delimited list.  WinItemize, however,
  6875.        creates a tab-delimited list of window titles since titles can have
  6876.        embedded blanks.
  6877.  
  6878.  
  6879.        Example:
  6880.         DirChange("c:\winword")
  6881.         alldotfiles = FileItemize("*.dot")
  6882.         dotfile = ItemSelect("W4W Templates", alldotfiles, " ")
  6883.         Run("winword.exe", dotfile)
  6884.  
  6885.        Which would produce:
  6886.  
  6887.  
  6888.  
  6889.  
  6890.  
  6891.  
  6892.  
  6893.  
  6894.  
  6895.  
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.        See Also:
  6909.           AskYesNo, DialogBox, DirItemize, Display, FileItemize, ItemCount,
  6910.           ItemExtract, Message, Pause, TextBox, TextSelect, WinItemize
  6911.  
  6912.  
  6913.  
  6914.  
  6915.        ItemSort
  6916.        Sorts a list.
  6917.  
  6918.  
  6919.        Syntax:
  6920.         ItemSort (list, delimiter)
  6921.  
  6922.        Parameters:
  6923.         (s) list     a string containing a list of items.
  6924.         (s) delimiter a character to act as a delimiter between items in the
  6925.                      list.
  6926.  
  6927.        Returns:
  6928.         (s)          new, sorted list.
  6929.  
  6930.        This function sorts a list, using an ANSI sort sequence.  It returns a
  6931.        new, sorted list; the original list is unchanged.
  6932.  
  6933.        If you create the list with the FileItemize or DirItemize functions
  6934.        you will be using a space-delimited list.  WinItemize, however,
  6935.        creates a tab-delimited list of window titles since titles can have
  6936.        embedded blanks.
  6937.  
  6938.  
  6939.        Example:
  6940.         newlist = ItemSort(list, delimiter)
  6941.  
  6942.  
  6943.        See Also:
  6944.           ItemExtract
  6945.  
  6946.  
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.        LastError
  6954.        Returns the most-recent error encountered during the current WIL
  6955.        program.
  6956.  
  6957.  
  6958.        Syntax:
  6959.         LastError ( )
  6960.  
  6961.        Parameters:
  6962.         (none)
  6963.  
  6964.        Returns:
  6965.         (i)          most-recent WIL error code encountered.
  6966.  
  6967.        WIL errors are numbered according to their severity.  "Minor" errors
  6968.        go from 1000 through 1999.  Moderate errors are 2000 through 2999.
  6969.        Fatal errors are numbered 3000 to 3999.
  6970.  
  6971.        Depending on which error mode is active when an error occurs, you may
  6972.        not get a chance to check the error code.  See ErrorMode for a
  6973.        discussion of default error handling.
  6974.  
  6975.        Don't bother checking for "fatal" error codes.  When a fatal error
  6976.        occurs, the WIL program is canceled before the next WIL statement gets
  6977.        to execute (regardless of which error mode is active).
  6978.  
  6979.        Every time the LastError function is called, the "last error"
  6980.        indicator is reset to zero.
  6981.  
  6982.        A full listing of possible errors you can encounter in processing a
  6983.        WIL program is in Appendix B (pg. 191).
  6984.  
  6985.  
  6986.        Example:
  6987.         ErrorMode(@OFF)
  6988.         FileCopy("data.dat", "c:\backups", @FALSE)
  6989.         ErrorMode(@CANCEL)
  6990.         If LastError() == 1006 Then Message("Error", "Please call  Tech
  6991.         Support at 555-9999.")
  6992.  
  6993.  
  6994.        See Also:
  6995.           Debug, ErrorMode
  6996.  
  6997.  
  6998.  
  6999.  
  7000.        LogDisk
  7001.        Logs (activates) a disk drive.
  7002.  
  7003.  
  7004.        Syntax:
  7005.         LogDisk (drive-letter)
  7006.  
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.        Parameters:
  7013.         (s) drive-letter   the disk drive to log into.
  7014.  
  7015.        Returns:
  7016.         (i)          @TRUE if the current drive was changed;
  7017.                      @FALSE if the drive doesn't exist.
  7018.  
  7019.        Use this function to change to a different disk drive.
  7020.  
  7021.  
  7022.        Example:
  7023.         LogDisk("c:")
  7024.  
  7025.  
  7026.        See Also:
  7027.           DirChange, DiskScan
  7028.  
  7029.  
  7030.  
  7031.  
  7032.        Max
  7033.        Returns largest number in a list of numbers.
  7034.  
  7035.  
  7036.        Syntax:
  7037.         Max (integer [, integer...])
  7038.  
  7039.        Parameters:
  7040.         (i) integer  an integer number.
  7041.  
  7042.        Returns:
  7043.         (i)          largest parameter.
  7044.  
  7045.        Use this function to determine the largest of a set of comma-delimited
  7046.        integers.
  7047.  
  7048.  
  7049.        Example:
  7050.         a = Max(5, -37, 125, 34, 2345, -32767)
  7051.         Message("Largest number is", a)
  7052.  
  7053.  
  7054.        See Also:
  7055.           Abs, Average, Min, Random
  7056.  
  7057.  
  7058.  
  7059.  
  7060.        MenuChange [*M]
  7061.        Checks, unchecks, enables, or disables a menu item.
  7062.  
  7063.  
  7064.        Syntax:
  7065.         MenuChange (menuname, flags)
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.  
  7072.        Parameters:
  7073.         (s) menuname menu item whose status you wish to change.
  7074.         (s) flags    @CHECK, @UNCHECK, @ENABLE, or @DISABLE.
  7075.  
  7076.        Returns:
  7077.         (i)          always 1.
  7078.  
  7079.        There are currently two ways you can modify a menu item:
  7080.  
  7081.        You can check and uncheck the item to imply that it corresponds to an
  7082.        option that can be turned on or off.
  7083.  
  7084.        You can temporarily disable the item (it shows up as gray) and later
  7085.        re-enable it.
  7086.  
  7087.        The two sets of flags (@Check/@UnCheck and @Enable/@Disable) can be
  7088.        combined in one function call by using the | (or) operator.
  7089.  
  7090.        Note: This command is not part of the WIL Interpreter package, but is
  7091.        documented here because it has been implemented in many of the shell
  7092.        or file manager-type applications which use the WIL Interpreter.
  7093.  
  7094.  
  7095.        Example:
  7096.         MenuChange("FilePrint", @Disable)
  7097.         MenuChange("WPWrite", @Enable | @Check)
  7098.  
  7099.  
  7100.        See Also:
  7101.           IsMenuChecked, IsMenuEnabled
  7102.  
  7103.  
  7104.  
  7105.  
  7106.        Message
  7107.        Displays a message to the user.
  7108.  
  7109.  
  7110.        Syntax:
  7111.         Message (title, text)
  7112.  
  7113.        Parameters:
  7114.         (s) title    title of the message box.
  7115.         (s) text     text to display in the message box.
  7116.  
  7117.        Returns:
  7118.         (i)          always 1.
  7119.  
  7120.        Use this function to display a message to the user.  The user must
  7121.        respond by selecting the OK button before processing will continue.
  7122.  
  7123.  
  7124.        Example:
  7125.         Message("Current directory is", DirGet())
  7126.  
  7127.        which produces:
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.        See Also:
  7142.           Display, Pause
  7143.  
  7144.  
  7145.  
  7146.  
  7147.        Min
  7148.        Returns lowest number in a list of numbers.
  7149.  
  7150.  
  7151.        Syntax:
  7152.         Min (integer [, integer...])
  7153.  
  7154.        Parameters:
  7155.         (i) integer  an integer number.
  7156.  
  7157.        Returns:
  7158.         (i)          lowest parameter.
  7159.  
  7160.        Use this function to determine the lowest of a set of comma-delimited
  7161.        integers.
  7162.  
  7163.  
  7164.        Example:
  7165.         a = Min( 5, -37, 125, 34, 2345, -32767)
  7166.         Message("Smallest number is", a)
  7167.  
  7168.  
  7169.        See Also:
  7170.           Abs, Average, Max, Random
  7171.  
  7172.  
  7173.  
  7174.  
  7175.        MouseInfo
  7176.        Returns assorted mouse information.
  7177.  
  7178.  
  7179.        Syntax:
  7180.         MouseInfo (request#)
  7181.  
  7182.        Parameters:
  7183.         (i) request# see below.
  7184.  
  7185.        Returns:
  7186.         (s)          see below.
  7187.  
  7188.        The information returned by MouseInfo depends on the value of
  7189.        request#.
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.           Req# Return value
  7196.  
  7197.           0    Window name under mouse
  7198.           1    Top level parent window name under mouse
  7199.           2    Mouse coordinates, assuming a 1000x1000 virtual screen
  7200.           3    Mouse coordinates in absolute numbers
  7201.           4    Status of mouse buttons, as a bitmask:
  7202.  
  7203.                  BinaryDecimal  Meaning
  7204.  
  7205.                  000   0      No buttons down
  7206.                  001   1      Right button down
  7207.                  010   2      Middle button down
  7208.                  011   3      Right and Middle buttons down
  7209.                  100   4      Left button down
  7210.                  101   5      Left and Right buttons down
  7211.                  110   6      Left and Middle buttons down
  7212.                  111   7      Left, Middle, and Right buttons down
  7213.  
  7214.        For example, if mouse is at the center of a 640x480 screen and above
  7215.        the "Clock" window, and the left button is down, the following values
  7216.        would be returned:
  7217.  
  7218.           Req# Return value
  7219.  
  7220.           1    "Clock"
  7221.           2    "500 500"
  7222.           3    "320 240"
  7223.           4    "4"
  7224.  
  7225.  
  7226.        Example:
  7227.         Display(1, "", "Press a mouse button to continue")
  7228.         :loop
  7229.         buttons = MouseInfo(4)
  7230.         If buttons == 0 Then Goto loop
  7231.         If buttons & 4 Then Display(1, "", "Left button was pressed")
  7232.         If buttons & 1 Then Display(1, "", "Right button was pressed")
  7233.  
  7234.  
  7235.        See Also:
  7236.           WinMetrics, WinParmGet
  7237.  
  7238.  
  7239.  
  7240.  
  7241.        NetAddCon
  7242.        Connects network resources to imaginary local disk drives or printer
  7243.        ports.
  7244.  
  7245.  
  7246.        Syntax:
  7247.         NetAddCon (net-path, password, local-name)
  7248.  
  7249.        Parameters:
  7250.         (s) net-path net resource or string returned by NetBrowse.
  7251.         (s) password password required to access resource, or "".
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.         (s) local-name     local drive name or printer port.
  7258.  
  7259.        Returns:
  7260.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7261.  
  7262.        You can use NetAddCon to connect a local drive to a network directory,
  7263.        in which case "local-name" will be a drive name (eg, "Z:").  You can
  7264.        also connect a local printer port to a network print queue, in which
  7265.        case "local-name" will be the name of the printer port (eg, "LPT1").
  7266.  
  7267.        Use the NetBrowse function to obtain a value for "net-path".
  7268.  
  7269.        If no password is required, use a null string ("") for the "password"
  7270.        parameter.
  7271.  
  7272.  
  7273.        Example:
  7274.         availdrive = DiskScan(0)
  7275.         drvlen = StrLen(availdrive)
  7276.         If drvlen == 0 Then Goto nomore
  7277.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  7278.         netpath = NetBrowse(0)
  7279.         pwd = AskPassword("Enter password for", netpath)
  7280.         NetAddCon(netpath, pwd, availdrive)
  7281.         Exit
  7282.         :nomore
  7283.         Message("Connect Drive to Net", "No drives avail for assignment")
  7284.  
  7285.  
  7286.        See Also:
  7287.           NetAttach, NetBrowse, NetCancelCon, NetGetCon, NetMapRoot
  7288.  
  7289.  
  7290.  
  7291.  
  7292.        NetAttach
  7293.        Attaches to a network file server.
  7294.  
  7295.  
  7296.        Syntax:
  7297.         NetAttach (server-name)
  7298.  
  7299.        Parameters:
  7300.         (s) server-name    name of the network file server.
  7301.  
  7302.        Returns:
  7303.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7304.  
  7305.        This function may not work with all networks.
  7306.  
  7307.  
  7308.        Example:
  7309.         NetAttach("userapps")
  7310.  
  7311.  
  7312.        See Also:
  7313.           NetAddCon, NetDetach, NetLogin
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.        NetBrowse
  7323.        Displays a network dialog box allowing the user to select a network
  7324.        resource.
  7325.  
  7326.  
  7327.        Syntax:
  7328.         NetBrowse (request#)
  7329.  
  7330.        Parameters:
  7331.         (i) request# see below.
  7332.  
  7333.        Returns:
  7334.         (s)          see below.
  7335.  
  7336.        Specifying a request# of 0 allows selection of a network directory,
  7337.        and specifying a request# of 1 allows selection of a network print
  7338.        queue.  This function returns a string that can be used by NetAddCon
  7339.        to add a connection.
  7340.  
  7341.  
  7342.        Example:
  7343.         availdrive = DiskScan(0)
  7344.         drvlen = StrLen(availdrive)
  7345.         If drvlen == 0 Then Goto nomore
  7346.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  7347.         netpath = NetBrowse(0)
  7348.         pswd = AskPassword("Enter password for", netpath)
  7349.         NetAddCon(netpath, pswd, availdrive)
  7350.         Exit
  7351.         :nomore
  7352.         Message("Connect Drive to Net", "No drives avail for assignment")
  7353.  
  7354.  
  7355.        See Also:
  7356.           NetAddCon, NetMapRoot
  7357.  
  7358.  
  7359.  
  7360.  
  7361.        NetCancelCon
  7362.        Breaks a network connection.
  7363.  
  7364.  
  7365.        Syntax:
  7366.         NetCancelCon (name, force)
  7367.  
  7368.        Parameters:
  7369.         (s) name     network resource name or local name.
  7370.         (i) force    force flag (see below).
  7371.  
  7372.        Returns:
  7373.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.        If force is set to 0, NetCancelCon will not break the connection if
  7380.        any files on that connection are still open.  If force is set to 1,
  7381.        the connection will be broken regardless.
  7382.  
  7383.  
  7384.        Example:
  7385.         availdrive = DiskScan(4)
  7386.         n = ItemCount(availdrive, " ")
  7387.         If n == 0 Then Exit
  7388.         i = 1
  7389.         dislist = ""
  7390.         :loop
  7391.         drv = ItemExtract(i, availdrive, " ")
  7392.         dislist = StrCat(drv, Num2Char(9), NetGetCon(drv), "|")
  7393.         i = i + 1
  7394.         If i < n Then Goto loop
  7395.         availdrive = ItemSelect("Disconnect", dislist, "|")
  7396.         NetCancelCon(availdrive, 0)
  7397.  
  7398.  
  7399.        See Also:
  7400.           NetAddCon, NetDetach, NetGetCon
  7401.  
  7402.  
  7403.  
  7404.  
  7405.        NetDetach
  7406.        Detaches from a network file server.
  7407.  
  7408.  
  7409.        Syntax:
  7410.         NetDetach (server-name)
  7411.  
  7412.        Parameters:
  7413.         (s) server-name    name of the network file server.
  7414.  
  7415.        Returns:
  7416.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7417.  
  7418.        This function may not work with all networks.
  7419.  
  7420.  
  7421.        Example:
  7422.         NetDetach("userapps")
  7423.  
  7424.  
  7425.        See Also:
  7426.           NetAttach, NetCancelCon
  7427.  
  7428.  
  7429.  
  7430.  
  7431.        NetDialog
  7432.        Brings up the network driver's dialog box.
  7433.  
  7434.  
  7435.  
  7436.  
  7437.  
  7438.  
  7439.        Syntax:
  7440.         NetDialog ( )
  7441.  
  7442.        Parameters:
  7443.         (none)
  7444.  
  7445.        Returns:
  7446.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7447.  
  7448.        A network driver's dialog box displays copyright information, and may
  7449.        allow access to the network, depending on the particular network
  7450.        driver.  The WIL program will wait until the network dialog terminates
  7451.        before continuing.
  7452.  
  7453.  
  7454.        Example:
  7455.         NetDialog()
  7456.  
  7457.  
  7458.  
  7459.        NetGetCaps
  7460.        Returns information on network capabilities.
  7461.  
  7462.  
  7463.        Syntax:
  7464.         NetGetCaps (request#)
  7465.  
  7466.        Parameters:
  7467.         (i) request# see below.
  7468.  
  7469.        Returns:
  7470.         (i)          see below.
  7471.  
  7472.        NetGetCaps returns 0 if no network is installed (it is the only
  7473.        network function you can use without having a network installed and
  7474.        not get an error).
  7475.  
  7476.           Req# Return value
  7477.  
  7478.           1    Network driver specification number
  7479.  
  7480.           2    Type of network installed:
  7481.                0    None
  7482.                256  MS Network
  7483.                512  Lan Manager
  7484.                768  Novell NetWare
  7485.                1024 Banyan Vines
  7486.                1280 10 Net
  7487.                (other)Other network
  7488.  
  7489.           3    Network driver version number
  7490.  
  7491.           4    Returns 1 if any network is installed
  7492.  
  7493.           6    Bitmask indicating whether the network driver supports the
  7494.           following
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.                connect functions:
  7501.                1    AddConnection
  7502.                2    CancelConnection
  7503.                4    GetConnection
  7504.                8    AutoConnect via DOS
  7505.                16   BrowseDialog
  7506.  
  7507.           7    Bitmask indicating whether the network driver supports the
  7508.           following
  7509.                print functions:
  7510.                2    Open Print Job
  7511.                4    Close Print Job
  7512.                16   Hold Print Job
  7513.                32   Release Print Job
  7514.                64   Cancel Print Job
  7515.                128  Set number of copies
  7516.                256  Watch Print Queue
  7517.                512  Unwatch Print Queue
  7518.                1024 Lock Queue Data
  7519.                2048 Unlock Queue Data
  7520.                4096 Driver will send QueueChanged messages to Print Manager
  7521.                8192 Abort Print Job
  7522.  
  7523.  
  7524.        Example:
  7525.         caps = NetGetCaps(6)
  7526.         If caps & 16 Then Message("", "Your network supports BrowseDialog")
  7527.  
  7528.        See Also:
  7529.           NetGetUser, WinConfig, WinMetrics, WinParmGet
  7530.  
  7531.  
  7532.  
  7533.  
  7534.        NetGetCon
  7535.        Returns the name of a connected network resource.
  7536.  
  7537.  
  7538.        Syntax:
  7539.         NetGetCon (local-name)
  7540.  
  7541.        Parameters:
  7542.         (s) local-name     local drive name or printer port.
  7543.  
  7544.        Returns:
  7545.         (s)          name of network resource.
  7546.  
  7547.        NetGetCon returns the name of the network resource currently connected
  7548.        to "local-name".
  7549.  
  7550.  
  7551.        Example:
  7552.         local = AskLine("NetGetCon", "Enter local drive name", "")
  7553.         If local == "" Then Exit
  7554.         resource = NetGetCon(local)
  7555.         Message("NetGetCon", "%local% is connected to %resource%")
  7556.  
  7557.  
  7558.  
  7559.  
  7560.  
  7561.  
  7562.        See Also:
  7563.           NetAddCon, NetCancelCon
  7564.  
  7565.  
  7566.  
  7567.  
  7568.        NetGetUser
  7569.        Returns the name of the user currently logged into the network.
  7570.  
  7571.  
  7572.        Syntax:
  7573.         NetGetUser ( )
  7574.  
  7575.        Parameters:
  7576.         (none)
  7577.  
  7578.        Returns:
  7579.         (s)          name of current user.
  7580.  
  7581.  
  7582.        Example:
  7583.         IniWritePvt("Current Users", "Excel", NetGetUser(), "usagelog.ini")
  7584.         Run("excel.exe", "")
  7585.  
  7586.  
  7587.        See Also:
  7588.           NetGetCaps
  7589.  
  7590.  
  7591.  
  7592.  
  7593.        NetLogin
  7594.        Performs a network login.
  7595.  
  7596.  
  7597.        Syntax:
  7598.         NetLogin (server-name, user-name, password)
  7599.  
  7600.        Parameters:
  7601.         (s) server-name    name of the network file server.
  7602.         (s) user-name name of the current user.
  7603.         (s) password password required to access server, or "".
  7604.  
  7605.        Returns:
  7606.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7607.  
  7608.        This function may not work with all networks.
  7609.  
  7610.  
  7611.        Example:
  7612.         pwd = AskPassword("Hello", "Enter password for network access")
  7613.         NetLogin("userapps", "admin1", pwd)
  7614.  
  7615.  
  7616.        See Also:
  7617.           NetAttach, NetLogout
  7618.  
  7619.  
  7620.  
  7621.  
  7622.  
  7623.  
  7624.  
  7625.  
  7626.        NetLogout
  7627.        Performs a network logout.
  7628.  
  7629.  
  7630.        Syntax:
  7631.         NetLogout (server-name)
  7632.  
  7633.        Parameters:
  7634.         (s) server-name    name of the network file server.
  7635.  
  7636.        Returns:
  7637.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7638.  
  7639.        This function may not work with all networks.
  7640.  
  7641.  
  7642.        Example:
  7643.         NetLogout("userapps")
  7644.  
  7645.  
  7646.        See Also:
  7647.           NetLogin
  7648.  
  7649.  
  7650.  
  7651.  
  7652.        NetMapRoot
  7653.        Maps a local drive to a network resource.
  7654.  
  7655.  
  7656.        Syntax:
  7657.         NetMapRoot (local-name, net-path)
  7658.  
  7659.        Parameters:
  7660.         (s) local-name     local drive name.
  7661.         (s) net-path net resource or string returned by NetBrowse.
  7662.  
  7663.        Returns:
  7664.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7665.  
  7666.        This function maps a local drive letter as the fake root to a network
  7667.        resource.  This is supported by Novell NetWare, but may not work with
  7668.        any other networks.
  7669.  
  7670.  
  7671.  
  7672.  
  7673.  
  7674.  
  7675.        Example:
  7676.         availdrive = DiskScan(0)
  7677.         drvlen = StrLen(availdrive)
  7678.         If drvlen == 0 Then Goto nomore
  7679.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  7680.         netpath = NetBrowse(0)
  7681.         NetMapRoot(availdrive, netpath)
  7682.         Exit
  7683.         :nomore
  7684.         Message("Connect Drive to Net", "No drives avail for assignment")
  7685.  
  7686.  
  7687.        See Also:
  7688.           NetAddCon, NetBrowse, NetCancelCon
  7689.  
  7690.  
  7691.  
  7692.  
  7693.        NetMemberGet
  7694.        Determines whether the current user is a member of a specific group.
  7695.  
  7696.  
  7697.        Syntax:
  7698.         NetMemberGet (server-name, group-name)
  7699.  
  7700.        Parameters:
  7701.         (s) server-name    name of the network file server.
  7702.         (s) group-name     name of the group.
  7703.  
  7704.        Returns:
  7705.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7706.  
  7707.        This function may not work with all networks.
  7708.  
  7709.  
  7710.        Example:
  7711.         member = NetMemberGet("userapps", "sales")
  7712.         If member == @YES Then Run("notepad.exe", "dailyrpt.txt")
  7713.  
  7714.  
  7715.        See Also:
  7716.           NetMemberSet
  7717.  
  7718.  
  7719.  
  7720.  
  7721.        NetMemberSet
  7722.        Sets the current user as a member of a group.
  7723.  
  7724.  
  7725.        Syntax:
  7726.         NetMemberSet (server-name, group-name)
  7727.  
  7728.        Parameters:
  7729.         (s) server-name    name of the network file server.
  7730.         (s) group-name     name of the group.
  7731.  
  7732.  
  7733.  
  7734.  
  7735.  
  7736.  
  7737.        Returns:
  7738.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7739.  
  7740.        This function may not work with all networks.
  7741.  
  7742.  
  7743.        Example:
  7744.         NetMemberSet("userapps", "sales")
  7745.  
  7746.  
  7747.        See Also:
  7748.           NetMemberGet
  7749.  
  7750.  
  7751.  
  7752.  
  7753.        NetMsgAll
  7754.        Broadcasts a message to all users on the network.
  7755.  
  7756.  
  7757.        Syntax:
  7758.         NetMsgAll (server-name, message)
  7759.  
  7760.        Parameters:
  7761.         (s) server-name    name of the network file server.
  7762.         (s) message  message to be broadcast.
  7763.  
  7764.        Returns:
  7765.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7766.  
  7767.        This function may not work with all networks.
  7768.  
  7769.  
  7770.        Example:
  7771.         NetMsgAll("userapps", "System going down in 5 minutes.")
  7772.  
  7773.  
  7774.        See Also:
  7775.           NetMsgSend
  7776.  
  7777.  
  7778.  
  7779.  
  7780.        NetMsgSend
  7781.        Sends a message to a specific user on the network.
  7782.  
  7783.  
  7784.        Syntax:
  7785.         NetMsgSend (server-name, user-name, message)
  7786.  
  7787.        Parameters:
  7788.         (s) server-name    name of the network file server.
  7789.         (s) user-name name of the user to whom the message should be sent.
  7790.         (s) message  message to be sent.
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.  
  7797.        Returns:
  7798.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7799.  
  7800.        This function may not work with all networks.
  7801.  
  7802.  
  7803.        Example:
  7804.         NetMsgSend("userapps", "compmgr", "Are those reports ready yet?")
  7805.  
  7806.  
  7807.        See Also:
  7808.           NetMsgAll
  7809.  
  7810.  
  7811.  
  7812.  
  7813.        Num2Char
  7814.        Converts a number to its character equivalent.
  7815.  
  7816.  
  7817.        Syntax:
  7818.         Num2Char (integer)
  7819.  
  7820.        Parameters:
  7821.         (i) number   any number from 0 to 255.
  7822.  
  7823.        Returns:
  7824.         (s)          one-byte string containing the character which the
  7825.                      number represents.
  7826.  
  7827.        Use this function to convert a number to its ASCII equivalent.
  7828.  
  7829.  
  7830.        Example:
  7831.         ; Build a variable containing a CRLF combo
  7832.         crlf = StrCat(Num2Char(13), Num2Char(10))
  7833.         Message("NUM2CHAR", StrCat("line1", crlf, "line2"))
  7834.  
  7835.  
  7836.        See Also:
  7837.           Char2Num, IsNumber
  7838.  
  7839.  
  7840.  
  7841.  
  7842.        ParseData
  7843.        Parses the passed string.
  7844.  
  7845.  
  7846.        Syntax:
  7847.         ParseData (string)
  7848.  
  7849.        Parameters:
  7850.         (s) string   string to be parsed.
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.        Returns:
  7858.         (i)          number of parameters in string.
  7859.  
  7860.        This function breaks a string constant or string variable into new
  7861.        sub-string variables named param1, param2, etc. (maximum of nine
  7862.        parameters).  Blank spaces in the original string are used as
  7863.        delimiters to create the new variables.
  7864.  
  7865.        Param0 is the count of how many sub-strings are found in "string".
  7866.  
  7867.  
  7868.        Example:
  7869.         username = AskLine("Hello", "Please enter your name","")
  7870.         ParseData(username)
  7871.  
  7872.        If the user enters:
  7873.  
  7874.           Joe Q. User
  7875.  
  7876.        ParseData would create the following variables:
  7877.  
  7878.           param1 ==   Joe
  7879.           param2 ==   Q.
  7880.           param3 ==   User
  7881.           param0 ==   3
  7882.  
  7883.  
  7884.        See Also:
  7885.           ItemExtract, StrSub
  7886.  
  7887.  
  7888.  
  7889.  
  7890.        Pause
  7891.        Provides a message to user.  User may cancel processing.
  7892.  
  7893.  
  7894.        Syntax:
  7895.         Pause (title, text)
  7896.  
  7897.        Parameters:
  7898.         (s) title    title of pause box.
  7899.         (s) text     text of the message to be displayed.
  7900.  
  7901.        Returns:
  7902.         (i)          always 1.
  7903.  
  7904.        This function displays a message to the user with an exclamation point
  7905.        icon.  The user may respond by selecting the OK button, or may cancel
  7906.        the processing by selecting Cancel.
  7907.  
  7908.        The Pause function is similar to the Message function, except for the
  7909.        addition of the Cancel button and icon.
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.        Example:
  7917.         Pause("Change Disks", "Insert new disk into Drive A:")
  7918.  
  7919.        which produces:
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.  
  7928.  
  7929.  
  7930.        See Also:
  7931.           Display, Exit, Message, Terminate
  7932.  
  7933.  
  7934.  
  7935.  
  7936.        PlayMedia
  7937.        Controls multimedia devices.
  7938.  
  7939.  
  7940.        Syntax:
  7941.         PlayMedia (command-string)
  7942.  
  7943.        Parameters:
  7944.         (s) command-string string to be sent to the multimedia device.
  7945.  
  7946.        Returns:
  7947.         (s)          response from the device.
  7948.  
  7949.        If the appropriate Windows multimedia extensions are present, this
  7950.        function can control multimedia devices.  Valid command strings depend
  7951.        on the multimedia devices and drivers installed.  The basic Windows
  7952.        multimedia package has a waveform device to play and record waveforms,
  7953.        and a sequencer device to play MID files.  Refer to the appropriate
  7954.        documentation for information on command strings.
  7955.  
  7956.        Many multimedia devices accept the WAIT or NOTIFY parameters as part
  7957.        of the command string:
  7958.  
  7959.           WAIT      Causes the system to stop processing input until the 
  7960.                     requested operation is complete.  You cannot switch
  7961.           tasks     when WAIT is specified.
  7962.  
  7963.           NOTIFY    Causes the WIL program to suspend execution until the 
  7964.                     requested operation completes.  You can perform other 
  7965.                     tasks and switch between tasks when NOTIFY is specified.
  7966.  
  7967.           WAIT NOTIFY Same as WAIT
  7968.  
  7969.        If neither WAIT nor NOTIFY is specified, the multimedia operation is
  7970.        started and control returns immediately to the WIL program.
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.        In general, if you simply want the WIL program to wait until the
  7977.        multimedia operation is complete, use the NOTIFY keyword.  If you want
  7978.        the system to hang until the operation is complete, use WAIT.  If you
  7979.        just want to start a multimedia operation and have the program
  7980.        continue processing, don't use either keyword.
  7981.  
  7982.        The return value from PlayMedia is whatever string the driver returns.
  7983.        This will depend on the particular driver, as well as on the type of
  7984.        operation performed.
  7985.  
  7986.  
  7987.        Example:
  7988.         ; Plays a music CD on a CDAudio player.  It plays whatever is in the
  7989.         ; drive, from start to finish
  7990.         stat = PlayMedia("status cdaudio mode")
  7991.         answer = 1
  7992.         If stat == "playing" Then answer = AskYesNo("CD Audio", "CD is
  7993.             Playing.  Stop?")
  7994.         If answer == 0 Then Exit
  7995.         PlayMedia("open cdaudio shareable alias donna notify")
  7996.         PlayMedia("set donna time format tmsf")
  7997.         PlayMedia("play donna from 1")
  7998.         PlayMedia("close donna")
  7999.         Exit
  8000.         :cancel
  8001.         PlayMedia("set cdaudio door open")
  8002.  
  8003.  
  8004.        See Also:
  8005.           Beep, PlayMidi, PlayWaveForm, Sounds
  8006.  
  8007.  
  8008.  
  8009.  
  8010.        PlayMidi
  8011.        Plays a MID or RMI sound file.
  8012.  
  8013.  
  8014.        Syntax:
  8015.         PlayMidi (filename, mode)
  8016.  
  8017.        Parameters:
  8018.         (s) filename name of the MID or RMI sound file.
  8019.         (i) mode     play mode (see below).
  8020.  
  8021.        Returns:
  8022.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  8023.  
  8024.        If Windows multimedia sound extensions are present, and MIDI-
  8025.        compatible hardware is installed, this function will play a MID or RMI
  8026.        sound file.  If "filename" is not in the current directory and a
  8027.        directory is not specified, the path will be searched to find the
  8028.        file.
  8029.  
  8030.        If "mode" is set to 0, the WIL program will wait for the sound file to
  8031.        complete before continuing.  If "mode" is set to 1, it will start
  8032.        playing the sound file and continue immediately.
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.        Example:
  8040.         PlayMidi("canyon.mid", 1)
  8041.  
  8042.  
  8043.        See Also:
  8044.           Beep, PlayMedia, PlayWaveForm, Sounds
  8045.  
  8046.  
  8047.  
  8048.  
  8049.        PlayWaveForm
  8050.        Plays a WAV sound file.
  8051.  
  8052.  
  8053.        Syntax:
  8054.         PlayWaveForm (filename, mode)
  8055.  
  8056.        Parameters:
  8057.         (s) filename
  8058.         (i) mode     play mode (see below).
  8059.  
  8060.        Returns:
  8061.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  8062.  
  8063.        If Windows multimedia sound extensions are present, and waveform-
  8064.        compatible hardware is installed, this function will play a WAV sound
  8065.        file.  If "filename" is not in the current directory and a directory
  8066.        is not specified, the path will be searched to find the file.  If
  8067.        "filename is not found, the WAV file associated with the
  8068.        "SystemDefault" keyword is played, (unless the "NoDefault" setting is
  8069.        on).
  8070.  
  8071.        Instead of specifying an actual filename, you may specify a keyword
  8072.        name from the [Sound] section of the WIN.INI file (eg, "SystemStart"),
  8073.        in which case the WAV file associated with that keyword name will be
  8074.        played.
  8075.  
  8076.        "Mode" is a bitmask, composed of the following bits:
  8077.  
  8078.           Mode Meaning
  8079.  
  8080.           0    Wait for the sound to end before continuing.
  8081.           1    Don't wait for the sound to end.  Start the sound and
  8082.           immediately process more statements.
  8083.           2    If sound file not found, do not play a default sound
  8084.           9    Continue playing the sound forever, or until a
  8085.                PlayWaveForm("", 0) statement is executed
  8086.           16   If another sound is already playing, do not interrupt it.
  8087.           Just ignore this PlayWaveForm request.
  8088.  
  8089.        You can combine these bits using the binary OR operator.
  8090.  
  8091.        The command PlayWaveForm("", 0) can be used at any time to stop sound.
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.        Examples:
  8099.         PlayWaveForm("tada.wav", 0)
  8100.  
  8101.         PlayWaveForm("SystemDefault", 1 | 16)
  8102.  
  8103.  
  8104.        See Also:
  8105.           Beep, PlayMedia, PlayMidi, Sounds
  8106.  
  8107.  
  8108.  
  8109.  
  8110.        Random
  8111.        Computes a pseudo-random number.
  8112.  
  8113.  
  8114.        Syntax:
  8115.         Random (max)
  8116.  
  8117.        Parameters:
  8118.         (i) max      largest desired integer number.
  8119.  
  8120.        Returns:
  8121.         (i)          unpredictable positive number.
  8122.  
  8123.        This function will return a random integer between 0 and max.
  8124.  
  8125.  
  8126.        Example:
  8127.         a = Random(79)
  8128.         Message("Random number between 0 and 79", a)
  8129.  
  8130.  
  8131.        See Also:
  8132.           Average, Max, Min
  8133.  
  8134.  
  8135.  
  8136.  
  8137.        Return
  8138.        Used to return from a Call to the calling program.
  8139.  
  8140.  
  8141.        Syntax:
  8142.         Return
  8143.  
  8144.        Parameters:
  8145.         (none)
  8146.  
  8147.        Returns:
  8148.         (not applicable)
  8149.  
  8150.  
  8151.        If the program was not called, then an Exit is assumed.
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.        Example:
  8159.         Display(2, "End of subroutine", "Returning to MAIN.WBT")
  8160.         Return
  8161.  
  8162.  
  8163.        See Also:
  8164.           Call, Exit
  8165.  
  8166.  
  8167.  
  8168.  
  8169.        Run
  8170.        Runs a program as a normal window.
  8171.  
  8172.  
  8173.        Syntax:
  8174.         Run (program-name, parameters)
  8175.  
  8176.        Parameters:
  8177.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8178.                      file, or a data file.
  8179.         (s) parameters     optional parameters as required by the
  8180.                      application.
  8181.  
  8182.        Returns:
  8183.         (i)          @TRUE if the program was found;
  8184.                      @FALSE if it wasn't.
  8185.  
  8186.        Use this command to run an application.
  8187.  
  8188.        If the drive and path are not part of the program name, the current
  8189.        directory will be examined first, followed by the Windows and Windows
  8190.        System directories, and then the DOS path will be searched to find the
  8191.        desired executable file.
  8192.  
  8193.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8194.        or .BAT, it will be run in accordance with whatever is in the
  8195.        [extensions] section of the WIN.INI file.  When this happens, any
  8196.        "parameters" you specified are ignored.
  8197.  
  8198.  
  8199.        Examples:
  8200.         Run("notepad.exe", "abc.txt")
  8201.  
  8202.         Run("clock.exe", "")
  8203.  
  8204.         Run("paint.exe", "pict.msp")
  8205.  
  8206.  
  8207.        See Also:
  8208.           AppExist, RunHide, RunIcon, RunWait, RunZoom, WinClose, WinExeName,
  8209.           WinWaitClose
  8210.  
  8211.  
  8212.  
  8213.  
  8214.  
  8215.  
  8216.  
  8217.  
  8218.        RunHide
  8219.        Runs a program as a hidden window.
  8220.  
  8221.  
  8222.        Syntax:
  8223.         RunHide (program-name, parameters)
  8224.  
  8225.        Parameters:
  8226.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8227.                      file, or a data file.
  8228.         (s) parameters     optional parameters as required by the
  8229.                      application.
  8230.  
  8231.        Returns:
  8232.         (i)          @TRUE if the program was found;
  8233.                      @FALSE if it wasn't.
  8234.  
  8235.        Use this command to run an application as a hidden window.
  8236.  
  8237.        If the drive and path are not part of the program name, the current
  8238.        directory will be examined first, followed by the Windows and Windows
  8239.        System directories, and then the DOS path will be searched to find the
  8240.        desired executable file.
  8241.  
  8242.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8243.        or .BAT, it will be run in accordance with whatever is in the
  8244.        [extensions] section of the WIN.INI file.  When this happens, any
  8245.        "parameters" you specified are ignored.
  8246.  
  8247.        Note:  When this command launches an application, it informs it that
  8248.        you want it to run as a hidden window.  Whether or not the application
  8249.        honors your wish is beyond RunHide's control.
  8250.  
  8251.  
  8252.        Examples:
  8253.         RunHide("notepad.exe", "abc.txt")
  8254.  
  8255.         RunHide("clock.exe", "")
  8256.  
  8257.         RunHide("paint.exe", "pict.msp")
  8258.  
  8259.  
  8260.        See Also:
  8261.           Run, RunHideWait, RunIcon, RunZoom, WinClose, WinExeName, WinHide,
  8262.           WinWaitClose
  8263.  
  8264.  
  8265.  
  8266.  
  8267.        RunHideWait
  8268.        Runs a program as a hidden window, and waits for it to close.
  8269.  
  8270.  
  8271.  
  8272.  
  8273.  
  8274.  
  8275.        Syntax:
  8276.         RunHideWait (program-name, parameters)
  8277.  
  8278.        Parameters:
  8279.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8280.                      file, or a data file.
  8281.         (s) parameters     optional parameters as required by the
  8282.                      application.
  8283.  
  8284.        Returns:
  8285.         (i)          @TRUE if the program was found;
  8286.                      @FALSE if it wasn't.
  8287.  
  8288.        Use this command to run an application as a hidden window.  The WIL
  8289.        program will suspend processing until the application is closed.
  8290.  
  8291.        If the drive and path are not part of the program name, the current
  8292.        directory will be examined first, followed by the Windows and Windows
  8293.        System directories, and then the DOS path will be searched to find the
  8294.        desired executable file.
  8295.  
  8296.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8297.        or .BAT, it will be run in accordance with whatever is in the
  8298.        [extensions] section of the WIN.INI file.  When this happens, any
  8299.        "parameters" you specified are ignored.
  8300.  
  8301.        Note:  When this command launches an application, it informs it that
  8302.        you want it to run as a hidden window.  Whether or not the application
  8303.        honors your wish is beyond RunHideWait's control.
  8304.  
  8305.  
  8306.        Example:
  8307.         NetAddCon("winword", "", "g:")
  8308.         RunHideWait("winword.exe", "")
  8309.         NetCancelCon("g:", 0)
  8310.  
  8311.  
  8312.        See Also:
  8313.           RunHide, RunIconWait, RunWait, RunZoomWait, WinWaitClose
  8314.  
  8315.  
  8316.  
  8317.  
  8318.        RunIcon
  8319.        Runs a program as an iconic (minimized) window.
  8320.  
  8321.  
  8322.        Syntax:
  8323.         RunIcon (program-name, parameters)
  8324.  
  8325.        Parameters:
  8326.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8327.                      file, or a data file.
  8328.         (s) parameters     optional parameters as required by the
  8329.                      application.
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.        Returns:
  8337.         (i)          @TRUE if the program was found;
  8338.                      @FALSE if it wasn't.
  8339.  
  8340.        Use this command to run an application as an icon.
  8341.  
  8342.        If the drive and path are not part of the program name, the current
  8343.        directory will be examined first, followed by the Windows and Windows
  8344.        System directories, and then the DOS path will be searched to find the
  8345.        desired executable file.
  8346.  
  8347.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8348.        or .BAT, it will be run in accordance with whatever is in the
  8349.        [extensions] section of the WIN.INI file.  When this happens, any
  8350.        "parameters" you specified are ignored.
  8351.  
  8352.        Note:  When this command launches an application, it merely informs it
  8353.        that you want it to begin as an icon.  Whether or not the application
  8354.        honors your wish is beyond RunIcon's control.
  8355.  
  8356.  
  8357.        Examples:
  8358.         RunIcon("notepad.exe", "abc.txt")
  8359.  
  8360.         RunIcon("clock.exe", "")
  8361.  
  8362.         RunIcon("paint.exe", "pict.msp")
  8363.  
  8364.  
  8365.        See Also:
  8366.           IconArrange, Run, RunHide, RunIconWait, RunZoom, WinClose,
  8367.           WinExeName, WinIconize, WinWaitClose
  8368.  
  8369.  
  8370.  
  8371.  
  8372.        RunIconWait
  8373.        Runs a program as an iconic (minimized) window, and waits for it to
  8374.        close.
  8375.  
  8376.  
  8377.        Syntax:
  8378.         RunIconWait (program-name, parameters)
  8379.  
  8380.        Parameters:
  8381.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8382.                      file, or a data file.
  8383.         (s) parameters     optional parameters as required by the
  8384.                      application.
  8385.  
  8386.        Returns:
  8387.         (i)          @TRUE if the program was found;
  8388.                      @FALSE if it wasn't.
  8389.  
  8390.        Use this command to run an application as an icon.  The WIL program
  8391.        will suspend processing until the application is closed.
  8392.  
  8393.  
  8394.  
  8395.  
  8396.  
  8397.        If the drive and path are not part of the program name, the current
  8398.        directory will be examined first, followed by the Windows and Windows
  8399.        System directories, and then the DOS path will be searched to find the
  8400.        desired executable file.
  8401.  
  8402.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8403.        or .BAT, it will be run in accordance with whatever is in the
  8404.        [extensions] section of the WIN.INI file.  When this happens, any
  8405.        "parameters" you specified are ignored.
  8406.  
  8407.        Note:  When this command launches an application, it merely informs it
  8408.        that you want it to begin as an icon.  Whether or not the application
  8409.        honors your wish is beyond RunIconWait's control.
  8410.  
  8411.  
  8412.        Example:
  8413.         NetAddCon("winword", "", "g:")
  8414.         RunIconWait("winword.exe", "")
  8415.         NetCancelCon("g:", 0)
  8416.  
  8417.  
  8418.        See Also:
  8419.           IconArrange, RunHideWait, RunIcon, RunWait, RunZoomWait,
  8420.           WinWaitClose
  8421.  
  8422.  
  8423.  
  8424.  
  8425.        RunWait
  8426.        Runs a program as a normal window, and waits for it to close.
  8427.  
  8428.  
  8429.        Syntax:
  8430.         RunWait (program-name, parameters)
  8431.  
  8432.        Parameters:
  8433.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8434.                      file, or a data file.
  8435.         (s) parameters     optional parameters as required by the
  8436.                      application.
  8437.  
  8438.        Returns:
  8439.         (i)          @TRUE if the program was found;
  8440.                      @FALSE if it wasn't.
  8441.  
  8442.        Use this command to run an application.  The WIL program will suspend
  8443.        processing until the application is closed.
  8444.  
  8445.        If the drive and path are not part of the program name, the current
  8446.        directory will be examined first, followed by the Windows and Windows
  8447.        System directories, and then the DOS path will be searched to find the
  8448.        desired executable file.
  8449.  
  8450.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8451.        or .BAT, it will be run in accordance with whatever is in the
  8452.        [extensions] section of the WIN.INI file.  When this happens, any
  8453.        "parameters" you specified are ignored.
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.        Example:
  8461.         NetAddCon("winword", "", "g:")
  8462.         RunWait("winword.exe", "")
  8463.         NetCancelCon("g:", 0)
  8464.  
  8465.  
  8466.        See Also:
  8467.           AppWaitClose, Run, RunHideWait, RunIconWait, RunZoomWait,
  8468.           WinWaitClose
  8469.  
  8470.  
  8471.  
  8472.  
  8473.        RunZoom
  8474.        Runs a program as a full-screen (maximized) window.
  8475.  
  8476.  
  8477.        Syntax:
  8478.         RunZoom (program-name, parameters)
  8479.  
  8480.        Parameters:
  8481.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8482.                      file, or a data file.
  8483.         (s) parameters     optional parameters as required by the
  8484.                      application.
  8485.  
  8486.        Returns:
  8487.         (i)          @TRUE if the program was found;
  8488.                      @FALSE if it wasn't.
  8489.  
  8490.        Use this command to run an application as a full-screen window.
  8491.  
  8492.        If the drive and path are not part of the program name, the current
  8493.        directory will be examined first, followed by the Windows and Windows
  8494.        System directories, and then the DOS path will be searched to find the
  8495.        desired executable file.
  8496.  
  8497.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8498.        or .BAT, it will be run in accordance with whatever is in the
  8499.        [Extensions] section of the WIN.INI file.  When this happens, any
  8500.        "parameters" you specified are ignored.
  8501.  
  8502.        Note:  When this command launches an application, it merely informs it
  8503.        that you want it to be maximized to full-screen.  Whether or not the
  8504.        application honors your wish is beyond RunZoom's control.
  8505.  
  8506.  
  8507.        Examples:
  8508.         RunZoom("notepad.exe", "abc.txt")
  8509.  
  8510.         RunZoom("clock.exe", "")
  8511.  
  8512.         RunZoom("paint.exe", "pict.msp")
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.        See Also:
  8520.           Run, RunHide, RunIcon, RunZoomWait, WinClose, WinExeName,
  8521.           WinWaitClose, WinZoom
  8522.  
  8523.  
  8524.  
  8525.  
  8526.        RunZoomWait
  8527.        Runs a program as a full-screen (maximized) window, and waits for it
  8528.        to close.
  8529.  
  8530.  
  8531.        Syntax:
  8532.         RunZoomWait (program-name, parameters)
  8533.  
  8534.        Parameters:
  8535.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8536.                      file, or a data file.
  8537.         (s) parameters     optional parameters as required by the
  8538.                      application.
  8539.  
  8540.        Returns:
  8541.         (i)          @TRUE if the program was found;
  8542.                      @FALSE if it wasn't.
  8543.  
  8544.        Use this command to run an application as a full-screen window.  The
  8545.        WIL program will suspend processing until the application is closed.
  8546.  
  8547.        If the drive and path are not part of the program name, the current
  8548.        directory will be examined first, followed by the Windows and Windows
  8549.        System directories, and then the DOS path will be searched to find the
  8550.        desired executable file.
  8551.  
  8552.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8553.        or .BAT, it will be run in accordance with whatever is in the
  8554.        [Extensions] section of the WIN.INI file.  When this happens, any
  8555.        "parameters" you specified are ignored.
  8556.  
  8557.        Note:  When this command launches an application, it merely informs it
  8558.        that you want it to be maximized to full-screen.  Whether or not the
  8559.        application honors your wish is beyond RunZoomWait's control.
  8560.  
  8561.  
  8562.        Example:
  8563.         NetAddCon("winword", "", "g:")
  8564.         RunZoomWait("winword.exe", "")
  8565.         NetCancelCon("g:", 0)
  8566.  
  8567.  
  8568.        See Also:
  8569.           RunHideWait, RunIconWait, RunWait, RunZoom, WinWaitClose
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.  
  8578.        SendKey
  8579.        Sends keystrokes to the active application.
  8580.  
  8581.  
  8582.        Syntax:
  8583.         SendKey (char-string)
  8584.  
  8585.        Parameters:
  8586.         (s) char-string    string of regular and/or special characters.
  8587.  
  8588.        Returns:
  8589.         (i)          always 0.
  8590.  
  8591.        This function is used to send keystrokes to the current window, just
  8592.        as if they had been entered from the keyboard.  Any alphanumeric
  8593.        character, and most punctuation marks and other symbols which appear
  8594.        on the keyboard, may be sent simply by placing it in the "char-
  8595.        string."  In addition, the following special characters, enclosed in
  8596.        "curly" braces, may be placed in "char-string" to send the
  8597.        corresponding special characters:
  8598.  
  8599.           Key         SendKey equivalent
  8600.  
  8601.           ~           {~}
  8602.           !           {!}
  8603.           ^           {^}
  8604.           +           {+}
  8605.  
  8606.           Alt         {ALT}
  8607.           Backspace   {BACKSPACE} or {BS}
  8608.           Caps Lock   {CAPSLOCK}
  8609.           Clear       {CLEAR}
  8610.           Delete      {DELETE} or {DEL}
  8611.           Down Arrow  {DOWN}
  8612.           End         {END}
  8613.           Enter       {ENTER} or ~
  8614.           Escape      {ESCAPE} or {ESC}
  8615.           F1 through F16   {F1} through {F16}
  8616.           Help        {HELP}
  8617.           Home        {HOME}
  8618.           Insert      {INSERT} or {INS}
  8619.           Left Arrow  {LEFT}
  8620.           Num Lock    {NUMLOCK}
  8621.           Page Down   {PGDN}
  8622.           Page Up     {PGUP}
  8623.           Print Screen{PRTSC}
  8624.           Right Arrow {RIGHT}
  8625.           Space       {SPACE} or {SP}
  8626.           Tab         {TAB}
  8627.           Up Arrow    {UP}
  8628.  
  8629.        To enter an Alt, Control, or Shift key combination, precede the
  8630.        desired character with one or more of the following symbols:
  8631.  
  8632.  
  8633.  
  8634.  
  8635.  
  8636.           Alt         !
  8637.           Control     ^
  8638.           Shift       +
  8639.  
  8640.        To enter Alt-S:
  8641.  
  8642.         SendKey("!S")
  8643.  
  8644.        To enter Ctrl-Shift-F7:
  8645.  
  8646.         SendKey("^+{F7}")
  8647.  
  8648.        You may also repeat a key by enclosing it in braces, followed by a
  8649.        space and the total number of repetitions desired.
  8650.  
  8651.        To type 20 asterisks:
  8652.  
  8653.         SendKey("{* 20}")
  8654.  
  8655.        To move the cursor down 8 lines:
  8656.  
  8657.         SendKey("{DOWN 8}")
  8658.  
  8659.        It is possible to use SendKey to send keystrokes to a DOS application,
  8660.        but only if you are running Windows in 386 Enhanced mode.  You would
  8661.        then transfer the keystrokes to the DOS application via the Clipboard.
  8662.        It is only possible to send standard ASCII characters to DOS
  8663.        applications; you cannot send function key or Alt-key combinations.
  8664.  
  8665.  
  8666.        Examples:
  8667.         ; start Notepad, and use *.* for filenames
  8668.         Run("notepad.exe", "")
  8669.         SendKey("!FO*.*~")
  8670.  
  8671.         ; run DOS batch file which starts our editor
  8672.         Run("edit.bat", "")
  8673.         ; wait 15 seconds for editor to load
  8674.         Delay(15)
  8675.         ; send string (with carriage return) to the clipboard
  8676.         crlf = StrCat(Num2Char(13), Num2Char(10))
  8677.         ClipPut("Hello%crlf%")
  8678.         ; paste contents of clipboard to DOS window
  8679.         SendKey("!{SP}EP")
  8680.  
  8681.  
  8682.        In those cases where you have an application which can accept text
  8683.        pasted in from the clipboard, it will often be more efficient to use
  8684.        the ClipGet function:
  8685.  
  8686.         Run("notepad.exe", "")
  8687.         crlf = StrCat(Num2Char(13), Num2Char(10))
  8688.         ; copy some text to the clipboard
  8689.         ClipPut("Dear Sirs:%crlf%%crlf%")
  8690.         ; paste the text into Notepad (using Shift-Ins)
  8691.         SendKey("+{INSERT}")
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.        See Also:
  8699.           ClipGet, SKDebug, SnapShot
  8700.  
  8701.  
  8702.  
  8703.  
  8704.        SKDebug
  8705.        Controls how SendKey works
  8706.  
  8707.  
  8708.        Syntax:
  8709.         SKDebug (mode)
  8710.  
  8711.        Parameters:
  8712.         (i) mode     @OFF       Keystrokes sent to application.  No debug
  8713.                      file  written.  Default mode.
  8714.                @ON         Keystrokes sent to application.  Debug file 
  8715.                            written.
  8716.                @PARSEONLY  Keystrokes not sent to application.  Debug file 
  8717.                            written.
  8718.  
  8719.        Returns:
  8720.         (i)    previous SKDebug mode.
  8721.  
  8722.        This function allows you to direct the keystrokes generated by your
  8723.        SendKey statements to a disk file in addition to, or instead of, the
  8724.        application window.  Normally, keystrokes are sent only to the
  8725.        application.  If you specify SKDebug (@ON), keystrokes are sent to a
  8726.        disk file as well as to the application.  If you specify SKDebug
  8727.        (@PARSEONLY), keystrokes are sent only to the disk file, and not to
  8728.        the application.  SKDebug (@OFF) returns to the default mode.
  8729.  
  8730.        By default, the file which will receive the parsed keystrokes is named
  8731.        C:\@@SKDBUG.TXT.  You can override this by making an entry in the
  8732.        WWWBATCH.INI file, in the [Main] section, as follows:
  8733.  
  8734.           SKDFile=debug.fil
  8735.  
  8736.        where debug.fil is the filename, including complete path
  8737.        specification, that you want to receive the keystrokes.
  8738.  
  8739.  
  8740.        Example:
  8741.         Run("notepad.exe", "")
  8742.         SKDebug(@ON)
  8743.         SendKey("!FO*.*~")
  8744.         SKDebug(@OFF)
  8745.  
  8746.  
  8747.        See Also:
  8748.           Debug, SendKey
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.        SnapShot
  8758.        Takes a snapshot of the screen and pastes it to the clipboard.
  8759.  
  8760.  
  8761.        Syntax:
  8762.         SnapShot (request#)
  8763.  
  8764.        Parameters:
  8765.         (i) request# see below.
  8766.  
  8767.        Returns:
  8768.         (i)          always 0.
  8769.  
  8770.           Req# Meaning
  8771.  
  8772.           0    Take snapshot of entire screen
  8773.           1    Take snapshot of client area of parent window of active window
  8774.           2    Take snapshot of entire area of parent window of active window
  8775.           3    Take snapshot of client area of active window
  8776.           4    Take snapshot of entire area of active window
  8777.  
  8778.  
  8779.        Example:
  8780.         SnapShot(2)
  8781.  
  8782.  
  8783.        See Also:
  8784.           ClipPut
  8785.  
  8786.  
  8787.  
  8788.  
  8789.        Sounds
  8790.        Turns sounds on or off.
  8791.  
  8792.  
  8793.        Syntax:
  8794.         Sounds (request#)
  8795.  
  8796.        Parameters:
  8797.         (i) request# see below.
  8798.  
  8799.        Returns:
  8800.         (i)          previous Sound setting.
  8801.  
  8802.        If Windows multimedia sound extensions are present, this function
  8803.        turns sounds made by the WIL Interpreter on or off.  Specify a
  8804.        request# of 0 to turn sounds off, and a request# of 1 to turn them on.
  8805.  
  8806.        By default, the WIL Interpreter makes noise.  You can override this by
  8807.        entering:
  8808.  
  8809.           Sounds=0
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.        in the [Main] section of the WWWBATCH.INI file.
  8816.  
  8817.  
  8818.        Example:
  8819.         Sounds(0)
  8820.  
  8821.        See Also:
  8822.           Beep, PlayMedia, PlayMidi, PlayWaveForm
  8823.  
  8824.  
  8825.  
  8826.  
  8827.        StrCat
  8828.        Concatenates two or more strings.
  8829.  
  8830.  
  8831.        Syntax:
  8832.         StrCat (string1, string2[, ..., stringN])
  8833.  
  8834.        Parameters:
  8835.         (s) string1, etc.  at least two strings you want to concatenate.
  8836.  
  8837.        Returns:
  8838.         (s)          concatenation of the entire list of input strings.
  8839.  
  8840.        Use this command to stick character strings together, or to format
  8841.        display messages.
  8842.  
  8843.  
  8844.        Example:
  8845.         user = AskLine("Login", "Your Name:", "")
  8846.         msg = StrCat("Hi, ", user)
  8847.         Message("Login", msg)
  8848.  
  8849.         ; note that this is the same as the second line above:
  8850.         msg = "Hi, %user%"
  8851.  
  8852.  
  8853.        See Also:
  8854.           StrFill, StrFix, StrTrim
  8855.  
  8856.  
  8857.  
  8858.  
  8859.        StrCmp
  8860.        Compares two strings.
  8861.  
  8862.  
  8863.        Syntax:
  8864.         StrCmp (string1, string2)
  8865.  
  8866.        Parameters:
  8867.         (s) string1, string2    strings to compare.
  8868.  
  8869.        Returns:
  8870.         (i)          -1, 0, or 1; depending on whether string1 is less than,
  8871.                      equal to, or greater than string2, respectively.
  8872.  
  8873.  
  8874.  
  8875.  
  8876.  
  8877.  
  8878.        Use this command to determine whether two strings are equal, or which
  8879.        precedes the other in an ANSI sorting sequence.
  8880.  
  8881.        Note:  This command has been included for semantic completeness.  The
  8882.        relational operators >, >=, ==, !=, <=, and < provide the same
  8883.        capability.
  8884.  
  8885.  
  8886.        Example:
  8887.         a = AskLine("STRCMP", "Enter a test line", "")
  8888.         b = AskLine("STRCMP", "Enter another test line", "")
  8889.         c = StrCmp(a, b)
  8890.         c = c + 1
  8891.         d = StrSub("less than   equal to    greater than", c * 12, 12)
  8892.         ; Note that above string is grouped into 12-character
  8893.         ; chunks.
  8894.         ; Desired chunk is removed with the StrSub statement.
  8895.         Message("STRCMP", "%a% is %d% %b%")
  8896.  
  8897.  
  8898.        See Also:
  8899.           StriCmp, StrIndex, StrLen, StrScan, StrSub
  8900.  
  8901.  
  8902.  
  8903.  
  8904.        StrFill
  8905.        Creates a string filled with a series of characters.
  8906.  
  8907.  
  8908.        Syntax:
  8909.         StrFill (filler, length)
  8910.  
  8911.        Parameters:
  8912.         (s) filler   a string to be repeated to create the return string.  If
  8913.                      the filler string is null, spaces will be used instead.
  8914.         (i) length   the length of the desired string.
  8915.  
  8916.        Returns:
  8917.         (s)          character string.
  8918.  
  8919.        Use this function to create a string consisting of multiple copies of
  8920.        the filler string concatenated together.
  8921.  
  8922.  
  8923.        Example:
  8924.         Message("My Stars", StrFill("*", 30))
  8925.  
  8926.        which produces:
  8927.  
  8928.  
  8929.  
  8930.  
  8931.  
  8932.  
  8933.        See Also:
  8934.           StrCat, StrFix, StrLen, StrTrim
  8935.  
  8936.  
  8937.  
  8938.  
  8939.        StrFix
  8940.        Pads or truncates a string to a fixed length.
  8941.  
  8942.  
  8943.        Syntax:
  8944.         StrFix (base-string, pad-string, length)
  8945.  
  8946.        Parameters:
  8947.         (s) base-string    string to be adjusted to a fixed length.
  8948.         (s) pad-string     appended to base-string if needed to fill out the
  8949.                      desired length.  If pad-string is null, spaces are used
  8950.                      instead.
  8951.         (i) length   length of the desired string.
  8952.  
  8953.        Returns:
  8954.         (s)          fixed size string.
  8955.  
  8956.        This function "fixes" the length of a string, either by truncating it
  8957.        on the right, or by appending enough copies of pad-string to achieve
  8958.        the desired length.
  8959.  
  8960.  
  8961.        Example:
  8962.         a = StrFix("Henry", " ", 15)
  8963.         b = StrFix("Betty", " ", 15)
  8964.         c = StrFix("George", " ", 15)
  8965.         Message("Spaced Names", StrCat(a, b, c))
  8966.  
  8967.        which produces:
  8968.  
  8969.  
  8970.  
  8971.  
  8972.  
  8973.  
  8974.  
  8975.  
  8976.  
  8977.        See Also:
  8978.           StrFill, StrLen, StrTrim
  8979.  
  8980.  
  8981.  
  8982.  
  8983.        StriCmp
  8984.        Compares two strings without regard to case.
  8985.  
  8986.  
  8987.        Syntax:
  8988.         StriCmp (string1, string2)
  8989.  
  8990.  
  8991.  
  8992.  
  8993.  
  8994.  
  8995.        Parameters:
  8996.         (s) string1, string2    strings to compare.
  8997.  
  8998.        Returns:
  8999.         (i)          -1, 0, or 1; depending on whether string1 is less than,
  9000.                      equal to, or greater than string2, respectively.
  9001.  
  9002.        Use this command to determine whether two strings are equal, or which
  9003.        precedes the other in an ANSI sorting sequence, when case is ignored.
  9004.  
  9005.  
  9006.        Example:
  9007.         a = AskLine("STRICMP", "Enter a test line", "")
  9008.         b = AskLine("STRICMP", "Enter another test line", "")
  9009.         c = StriCmp(a, b)
  9010.         c = c + 1
  9011.         d = StrSub("less than   equal to    greater than", c * 12, 12)
  9012.         ; Note that above string is grouped into 12-character
  9013.         ; chunks.
  9014.         ; Desired chunk is removed with the StrSub statement.
  9015.         Message("STRICMP", "%a% is %d% %b%")
  9016.  
  9017.  
  9018.        See Also:
  9019.           StrCmp, StrIndex, StrLen, StrScan, StrSub
  9020.  
  9021.  
  9022.  
  9023.  
  9024.        StrIndex
  9025.        Searches a string for a substring.
  9026.  
  9027.  
  9028.        Syntax:
  9029.         StrIndex (string, substring, start, direction)
  9030.  
  9031.        Parameters:
  9032.         (s) string   the string to be searched for a substring.
  9033.         (s) substring the string to look for within the main string.
  9034.         (i) start    the position in the main string to begin search.  The
  9035.                      first character of a string is position 1.
  9036.         (i) direction the search direction.  @FWDSCAN searches forward, while
  9037.                      @BACKSCAN searches backwards.
  9038.  
  9039.        Returns:
  9040.         (i)          position of substring within string, or 0 if not found.
  9041.  
  9042.        This function searches for a substring within a "target" string.
  9043.        Starting at the "start" position, it goes forward or backward
  9044.        depending on the value of the "direction" parameter.  It stops when it
  9045.        finds the "substring" within the "target" string, and returns its
  9046.        position.
  9047.  
  9048.        A start position of 0 has special meaning depending on which direction
  9049.        you are scanning.  For forward searches, zero indicates the search
  9050.  
  9051.  
  9052.  
  9053.  
  9054.  
  9055.        should start at the beginning of the string.  For reverse searches,
  9056.        zero causes it to start at the end of the string.
  9057.  
  9058.  
  9059.        Example:
  9060.         instr = AskLine("STRINDEX", "Type a sentence:", "")
  9061.         start = 1
  9062.         end = StrIndex(instr, " ", start, @FWDSCAN)
  9063.         If end == 0 Then Goto error
  9064.         Message("STRINDEX", StrCat("The first word is: ", StrSub(instr, 
  9065.             start, end - 1))
  9066.         Exit
  9067.         :error
  9068.         Message("Sorry...", "No spaces found")
  9069.  
  9070.  
  9071.        See Also:
  9072.           StrLen, StrScan, StrSub
  9073.  
  9074.  
  9075.  
  9076.  
  9077.        StrLen
  9078.        Provides the length of a string.
  9079.  
  9080.  
  9081.        Syntax:
  9082.         StrLen (string)
  9083.  
  9084.        Parameters:
  9085.         (s) string   any text string.
  9086.  
  9087.        Returns:
  9088.         (i)          length of string.
  9089.  
  9090.        Use this command to determine the length of a string variable or
  9091.        expression.
  9092.  
  9093.  
  9094.        Example:
  9095.         myfile = AskLine("Filename", "File to process:", "")
  9096.         namlen = StrLen(myfile)
  9097.         If namlen > 13 Then Message("", "Filename too long!")
  9098.  
  9099.  
  9100.        See Also:
  9101.           StrFill, StrFix, StrIndex, StrScan, StrTrim
  9102.  
  9103.  
  9104.  
  9105.  
  9106.        StrLower
  9107.        Converts a string to lowercase.
  9108.  
  9109.  
  9110.        Syntax:
  9111.         StrLower (string)
  9112.  
  9113.  
  9114.  
  9115.  
  9116.  
  9117.  
  9118.        Parameters:
  9119.         (s) string   any text string.
  9120.  
  9121.        Returns:
  9122.         (s)          lowercase string.
  9123.  
  9124.        Use this command to convert a text string to lower case.
  9125.  
  9126.  
  9127.        Example:
  9128.         a = AskLine("STRLOWER", "Enter text", "")
  9129.         b = StrLower(a)
  9130.         Message(a, b)
  9131.  
  9132.  
  9133.        See Also:
  9134.           StriCmp, StrUpper
  9135.  
  9136.  
  9137.  
  9138.  
  9139.        StrReplace
  9140.        Replaces all occurances of a substring with another.
  9141.  
  9142.  
  9143.        Syntax:
  9144.         StrReplace (string, old, new)
  9145.  
  9146.        Parameters:
  9147.         (s) string   string in which to search.
  9148.         (s) old      target substring.
  9149.         (s) new      replacement substring.
  9150.  
  9151.        Returns:
  9152.         (s)          updated string, with old replaced by new.
  9153.  
  9154.  
  9155.        StrReplace scans the "string", searching for occurrences of "old" and
  9156.        replacing each occurrence with "new".
  9157.  
  9158.  
  9159.        Example:
  9160.         ; Copy all INI files to clipboard
  9161.         a = FileItemize("*.ini")
  9162.         crlf = StrCat(Num2Char(13), Num2Char(10))
  9163.         b = StrReplace(a, " ", crlf)
  9164.         ClipPut(b)
  9165.  
  9166.  
  9167.        See Also:
  9168.           StrIndex, StrScan, StrSub
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.        StrScan
  9178.        Searches string for occurrence of delimiters.
  9179.  
  9180.  
  9181.        Syntax:
  9182.         StrScan (string, delimiters, start, direction)
  9183.  
  9184.        Parameters:
  9185.         (s) string   the string that is to be searched.
  9186.         (s) delimiters     a string of delimiters to search for within
  9187.                      string.
  9188.         (i) start    the position in the main string to begin search.  The
  9189.                      first character of a string is position 1.
  9190.         (i) direction the search direction.  @FWDSCAN searches forward, while
  9191.                      @BACKSCAN searches backwards.
  9192.  
  9193.        Returns:
  9194.         (i)          position of delimiter in string, or 0 if not found.
  9195.  
  9196.        This function searches for delimiters within a target "string".
  9197.        Starting at the "start" position, it goes forward or backward
  9198.        depending on the value of the "direction" parameter.  It stops when it
  9199.        finds any one of the characters in the "delimiters" string within the
  9200.        target "string".
  9201.  
  9202.  
  9203.        Example:
  9204.         thestr = "123,456.789:abc"
  9205.         start = 1
  9206.         end = StrScan(thestr, ",.:", start, @FWDSCAN)
  9207.         If end == 0 Then Goto error
  9208.         Message("The first parameter", StrSub(thestr, start, end -      start
  9209.         + 1))
  9210.         Exit
  9211.         :error
  9212.         Message("Sorry...", "No delimiters found")
  9213.  
  9214.  
  9215.        See Also:
  9216.           StrLen, StrSub
  9217.  
  9218.  
  9219.  
  9220.  
  9221.        StrSub
  9222.        Extracts a substring out of an existing string.
  9223.  
  9224.  
  9225.        Syntax:
  9226.         StrSub (string, start, length)
  9227.  
  9228.        Parameters:
  9229.         (s) string   the string from which the substring is to be extracted.
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.         (i) start    character position within string where the substring
  9236.                      starts.  (The first character of the string is at
  9237.                      position 1).
  9238.         (i) length   length of desired substring.  If you specify a length of
  9239.                      zero it will return a null string.
  9240.  
  9241.        Returns:
  9242.         (s)          substring of parameter string.
  9243.  
  9244.        This function extracts a substring from within a "target" string.
  9245.        Starting at the "start" position, it copies up to "length" characters
  9246.        into the substring.
  9247.  
  9248.  
  9249.        Example:
  9250.         a = "My dog has fleas"
  9251.         animal = StrSub(a, 4, 3)
  9252.         Message("STRSUB", "My animal is a %animal%")
  9253.  
  9254.  
  9255.        See Also:
  9256.           StrLen, StrScan
  9257.  
  9258.  
  9259.  
  9260.  
  9261.        StrTrim
  9262.        Removes leading and trailing blanks from a character string.
  9263.  
  9264.  
  9265.        Syntax:
  9266.         StrTrim (string)
  9267.  
  9268.        Parameters:
  9269.         (s) string   a string with unwanted spaces at the beginning and/or
  9270.                      end.
  9271.  
  9272.        Returns:
  9273.         (s)          string devoid of leading and trailing spaces.
  9274.  
  9275.        This function removes spaces and tab characters from the beginning and
  9276.        end of a text string.
  9277.  
  9278.  
  9279.        Example:
  9280.         myfile = AskLine("STRTRIM", "Filename ('exit' cancels)", "")
  9281.         tstexit = StrTrim(StrLower(myfile))
  9282.         If tstexit == "exit" Then Goto cancel
  9283.         ; processing of myfile continues...
  9284.         : cancel
  9285.         Message("Canceled", "...by user request")
  9286.  
  9287.  
  9288.        See Also:
  9289.           StrFill, StrFix, StrLen
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.  
  9297.  
  9298.        StrUpper
  9299.        Converts a string to uppercase.
  9300.  
  9301.  
  9302.        Syntax:
  9303.         StrUpper (string)
  9304.  
  9305.        Parameters:
  9306.         (s) string   any text string.
  9307.  
  9308.        Returns:
  9309.         (s)          uppercase string.
  9310.  
  9311.        Use this function to convert a text string to upper case.
  9312.  
  9313.  
  9314.        Example:
  9315.         a = AskLine("STRUPPER", "Enter text","")
  9316.         b = StrUpper(a)
  9317.         Message(a, b)
  9318.  
  9319.  
  9320.        See Also:
  9321.           StriCmp, StrLower
  9322.  
  9323.  
  9324.  
  9325.  
  9326.        Terminate
  9327.        Conditionally ends a WIL program.
  9328.  
  9329.  
  9330.        Syntax:
  9331.         Terminate (expression, title, message)
  9332.  
  9333.        Parameters:
  9334.         (s) expression     any logical expression.
  9335.         (s) title    the title of a message box to be displayed before
  9336.                      termination.
  9337.         (s) message  the message in the message box.
  9338.  
  9339.        Returns:
  9340.         (i)          always 1.
  9341.  
  9342.        This command ends processing for the WIL program if "expression" is
  9343.        nonzero.  Note that many functions return @TRUE (1) or @FALSE (0),
  9344.        which you can use to decide whether to cancel a menu item.
  9345.  
  9346.        If either "title" or "message" contains a string, a message box with a
  9347.        title and a message is displayed before exiting.
  9348.  
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.        Examples:
  9355.         ; unconditional termination w/o message box (same as Exit)
  9356.         Terminate(@TRUE, "", "")
  9357.  
  9358.         ; basically a no-op:
  9359.         Terminate(@FALSE, "", "This will never terminate")
  9360.  
  9361.         ; exits with message if variable is less than zero:
  9362.         Terminate(a < 0, "Error", "Cannot use negative numbers")
  9363.  
  9364.         ; exits w/o message if answer isn't "YES":
  9365.         Terminate(answer != "YES", "", "")
  9366.  
  9367.  
  9368.        See Also:
  9369.           Display, Exit, Message, Pause
  9370.  
  9371.  
  9372.  
  9373.  
  9374.        TextBox
  9375.        Displays a file in a listbox on the screen and returns selected line,
  9376.        if any.
  9377.  
  9378.  
  9379.        Syntax:
  9380.         TextBox (title, filename)
  9381.  
  9382.        Parameters:
  9383.         (s) title    listbox title.
  9384.         (s) filename file containing contents of listbox.
  9385.  
  9386.        Returns:
  9387.         (s)          highlighted string, if any.
  9388.  
  9389.        This function loads a file into a Windows listbox and displays the
  9390.        listbox to the user.  TextBox has two primary uses:  First, it can be
  9391.        used to display multi-line messages to the user.  In addition, because
  9392.        of its ability to return a selected line, it may be used as a multiple
  9393.        choice question box.  The line highlighted by the user (if any) will
  9394.        be returned to the program.
  9395.  
  9396.        If disk drive and path not are part of the filename, the current
  9397.        directory will be examined first, and then the DOS path will be
  9398.        searched to find the desired file.
  9399.  
  9400.  
  9401.        Example:
  9402.         ; Display WIN.INI
  9403.         a = TextBox("Choose a line", "c:\windows\win.ini")
  9404.         Display(3, "Chosen line", a)
  9405.  
  9406.        which produces (at least on my system):
  9407.  
  9408.  
  9409.  
  9410.  
  9411.  
  9412.  
  9413.  
  9414.  
  9415.  
  9416.  
  9417.  
  9418.  
  9419.  
  9420.  
  9421.  
  9422.  
  9423.  
  9424.  
  9425.  
  9426.  
  9427.  
  9428.        and then:
  9429.  
  9430.  
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.        See Also:
  9437.           ItemSelect, TextSelect
  9438.  
  9439.  
  9440.  
  9441.  
  9442.        TextSelect
  9443.        Allows the user to choose an item from an unsorted listbox.
  9444.  
  9445.  
  9446.        Syntax:
  9447.         TextSelect (title, list, delimiter)
  9448.  
  9449.        Parameters:
  9450.         (s) title    the title of dialog box to display.
  9451.         (s) list     a string containing a list of items to choose from.
  9452.         (s) delimiter a string containing the character to act as delimiter
  9453.                      between items in the list.
  9454.  
  9455.        Returns:
  9456.         (s)          the selected item.
  9457.  
  9458.        This function displays a dialog box with a listbox inside.  This
  9459.        listbox is filled with an unsorted list of items taken from a string
  9460.        you provide to the function.
  9461.  
  9462.        Each item in the string must be separated (delimited) by a character,
  9463.        which you also pass to the function.
  9464.  
  9465.        The user selects one of the items by either doubleclicking on it, or
  9466.        single-clicking and pressing OK.  The item is returned as a string.
  9467.  
  9468.  
  9469.  
  9470.  
  9471.  
  9472.        If you create the list with the FileItemize or DirItemize functions
  9473.        you will be using a space-delimited list.  WinItemize, however,
  9474.        creates a tab-delimited list of window titles since titles can have
  9475.        embedded blanks.
  9476.  
  9477.        TextSelect is like ItemSelect, except that with TextSelect the
  9478.        displayed box is larger and the items in the box are not sorted
  9479.        alphabetically.
  9480.  
  9481.  
  9482.        Example:
  9483.         DirChange(DirWindows(0))
  9484.         inifiles = FileItemize("*.ini")
  9485.         ini = TextSelect("Select an INI file to edit", inifiles, " ")
  9486.         If ini == "" Then Exit
  9487.         RunZoom("notepad.exe", ini)
  9488.  
  9489.  
  9490.        See Also:
  9491.           AskLine, DialogBox, DirItemize, FileItemize, ItemSelect, TextBox,
  9492.           WinItemize
  9493.  
  9494.  
  9495.  
  9496.  
  9497.        Then
  9498.        Continues a previous If statement.
  9499.  
  9500.  
  9501.        Syntax:
  9502.         Then statement
  9503.  
  9504.        Parameters:
  9505.         (s) statement any valid WIL function or command.
  9506.  
  9507.        This command continues the last-encountered If command.  It provides a
  9508.        method of conditionally executing multiple statements, without having
  9509.        to test the condition more than once.  If the previous If condition
  9510.        was true, the statement following the Then keyword is executed.  If
  9511.        the previous If condition was false, the statement following the Then
  9512.        keyword is ignored.
  9513.  
  9514.  
  9515.  
  9516.  
  9517.        Example:
  9518.         answer = AskYesNo("Financial Management", "Run WinCheck now?")
  9519.         If answer == @YES Then DirChange("c:\win\check")
  9520.         Then Run("wincheck.exe", "")
  9521.         Then WinWaitClose("WinCheck")
  9522.         Message("Okay", "Processing complete")
  9523.  
  9524.  
  9525.        See Also:
  9526.           Else, Goto, If ... Then
  9527.  
  9528.  
  9529.  
  9530.  
  9531.  
  9532.  
  9533.  
  9534.  
  9535.        Version
  9536.        Returns the version number of the parent program currently running.
  9537.  
  9538.  
  9539.        Syntax:
  9540.         Version ( )
  9541.  
  9542.        Parameters:
  9543.         (none)
  9544.  
  9545.        Returns:
  9546.         (s)          parent program version number.
  9547.  
  9548.        Use this function to determine the version of the parent program that
  9549.        is currently running.
  9550.  
  9551.  
  9552.        Example:
  9553.         ver = Version()
  9554.         Message("Version number", ver)
  9555.  
  9556.  
  9557.        See Also:
  9558.           DOSVersion, Environment, VersionDLL WinVersion
  9559.  
  9560.  
  9561.  
  9562.  
  9563.        VersionDLL
  9564.        Returns the version number of the WIL Interpreter currently running.
  9565.  
  9566.  
  9567.        Syntax:
  9568.         VersionDLL ( )
  9569.  
  9570.        Parameters:
  9571.         (none)
  9572.  
  9573.        Returns:
  9574.         (s)          WIL Interpreter version number.
  9575.  
  9576.        Use this function to determine the version of the WIL Interpreter that
  9577.        is currently running.  It is useful to verify that a WIL program
  9578.        generated with the latest version of the language will operate
  9579.        properly on what may be a different machine with a different version
  9580.        of the WIL Interpreter installed.
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586.  
  9587.        Example:
  9588.         ver = VersionDLL()
  9589.         If ver >= "1.0c" Then Goto proceed
  9590.         Message("Sorry", "WIL Interpreter version 1.0c or higher required")
  9591.         Exit
  9592.         :proceed
  9593.         NetDialog()
  9594.  
  9595.  
  9596.        See Also:
  9597.           DOSVersion, Environment, Version, WinVersion
  9598.  
  9599.  
  9600.  
  9601.  
  9602.        WaitForKey
  9603.        Waits for a specific key to be pressed.
  9604.  
  9605.  
  9606.        Syntax:
  9607.         WaitForKey (key1, key2, key3, key4, key5)
  9608.  
  9609.        Parameters:
  9610.         (s) key1 - key5    five keystrokes to wait for.
  9611.  
  9612.        Returns:
  9613.         (i)          position of the selected keystroke (1-5).
  9614.  
  9615.        WaitForKey requires five parameters, each of which represents a
  9616.        keystroke (refer to the SendKey function for a list of special
  9617.        keycodes which can be used).  The WIL program will be suspended until
  9618.        one of the specified keys are pressed, at which time the WaitForKey
  9619.        function will return a number from 1 to 5, indicating the position of
  9620.        the "key" that was selected, and the program will continue.  You can
  9621.        specify a null string ("") for one or more of the "key" parameters if
  9622.        you don't need to use all five.
  9623.  
  9624.        WaitForKey will detect its keystrokes in most, but not all, Windows
  9625.        applications.  Any keystroke that is pressed is also passed on to the
  9626.        underlying application.
  9627.  
  9628.  
  9629.        Example:
  9630.         k = WaitForKey("{F11}", "{F12}", "{INSERT}", "", "")
  9631.         If k == 1 Then Message("WaitForKey", "You pressed the F11 key")
  9632.         If k == 2 Then Message("WaitForKey", "You pressed the F12 key")
  9633.         If k == 3 Then Message("WaitForKey", "You pressed the Insert key")
  9634.  
  9635.  
  9636.        See Also:
  9637.           IgnoreInput, IsKeyDown
  9638.  
  9639.  
  9640.  
  9641.  
  9642.  
  9643.  
  9644.  
  9645.  
  9646.        WallPaper
  9647.        Changes the Windows wallpaper.
  9648.  
  9649.  
  9650.        Syntax:
  9651.         WallPaper (bmp-name, tile)
  9652.  
  9653.  
  9654.        Parameters:
  9655.         (s) bmp-name Name of the BMP wallpaper file.
  9656.         (i) tile     @TRUE if wallpaper should be tiled;
  9657.                      @FALSE if wallpaper should not be tiled.
  9658.  
  9659.        Returns:
  9660.         (i)          always 0.
  9661.  
  9662.        This function immediately changes the Windows wallpaper.  It can even
  9663.        be used for wallpaper "slide shows."
  9664.  
  9665.  
  9666.        Example:
  9667.         DirChange("c:\windows")
  9668.         a = FileItemize("*.bmp")
  9669.         a = ItemSelect("Select New paper", a, " ")
  9670.         tile = @FALSE
  9671.         If FileSize(a) < 40000 Then tile = @TRUE
  9672.         Wallpaper(a, tile)
  9673.  
  9674.  
  9675.        See Also:
  9676.           WinParmSet
  9677.  
  9678.  
  9679.  
  9680.  
  9681.        WinActivate
  9682.        Activates a previously running window.
  9683.  
  9684.  
  9685.        Syntax:
  9686.         WinActivate (partial-winname)
  9687.  
  9688.        Parameters:
  9689.         (s) partial-winname     either an initial portion of, or an entire
  9690.                      window name.  The most-recently used window whose title
  9691.                      matches the name will be activated.
  9692.  
  9693.        Returns:
  9694.         (i)          @TRUE if a window was found to activate;
  9695.                      @FALSE if no windows were found.
  9696.  
  9697.        Use this function to activate windows for user input.
  9698.  
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.        Example:
  9705.         Run("notepad.exe", "")
  9706.         Run("clock.exe", "")
  9707.         WinActivate("Notepad")
  9708.  
  9709.  
  9710.        See Also:
  9711.           WinCloseNot, WinGetActive, WinName, WinShow
  9712.  
  9713.  
  9714.  
  9715.  
  9716.        WinArrange
  9717.        Arranges, tiles, and/or stacks application windows.
  9718.  
  9719.  
  9720.        Syntax:
  9721.         WinArrange (style)
  9722.  
  9723.        Parameters:
  9724.         (i) style    one of the following: @STACK, @TILE (or @ARRANGE),
  9725.                      @ROWS, or @COLUMNS.
  9726.  
  9727.        Returns:
  9728.         (i)          always 1.
  9729.  
  9730.        Use this function to rearrange the open windows on the screen.  (Any
  9731.        iconized programs are unaffected.)
  9732.  
  9733.        If there are more than four open windows and you specify @ROWS, or if
  9734.        there are more than three open windows and you specify @COLUMNS, @TILE
  9735.        will be used instead.
  9736.  
  9737.  
  9738.        Example:
  9739.         ; Reveal all windows
  9740.         WinArrange(@TILE)
  9741.  
  9742.  
  9743.        See Also:
  9744.           IconArrange, WinHide, WinIconize, WinItemize, WinPlace, WinShow,
  9745.           WinZoom
  9746.  
  9747.  
  9748.  
  9749.  
  9750.        WinClose
  9751.        Closes an open window.
  9752.  
  9753.  
  9754.        Syntax:
  9755.         WinClose (partial-winname)
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.        Parameters:
  9763.         (s) partial-winname     either an initial portion of, or an entire
  9764.                      window name.  The most-recently used window whose title
  9765.                      matches the name will be closed.
  9766.  
  9767.        Returns:
  9768.         (i)          @TRUE if a window was found to close;
  9769.                      @FALSE if no windows were found.
  9770.  
  9771.        Use this function to close windows.
  9772.  
  9773.        WinClose will not close the window which contains the currently-
  9774.        executing WIL file.  You can, however, use EndSession to end the
  9775.        current Windows session.
  9776.  
  9777.  
  9778.        Example:
  9779.         Run("notepad.exe", "")
  9780.         WinClose("Notepad")
  9781.  
  9782.  
  9783.        See Also:
  9784.           EndSession, WinCloseNot, WinHide, WinIconize, WinItemize,
  9785.           WinWaitClose
  9786.  
  9787.  
  9788.  
  9789.  
  9790.        WinCloseNot
  9791.        Closes all windows, except those provided as parameters.
  9792.  
  9793.  
  9794.        Syntax:
  9795.         WinCloseNot (partial-winname [, partial-winname...])
  9796.  
  9797.        Parameters:
  9798.         (s) partial-winname     either an initial portion of, or an entire
  9799.                      window name.  Any windows whose titles match the partial
  9800.                      names will stay open.
  9801.  
  9802.        Returns:
  9803.         (i)          always 1.
  9804.  
  9805.        Use this function to close all windows except those specifically
  9806.        listed in the parameter strings.
  9807.  
  9808.        At least one partial window name must be given.  A null-string
  9809.        parameter would match all windows, or, in other words, close nothing.
  9810.  
  9811.  
  9812.        Example:
  9813.         ; The statement below will close all windows except:
  9814.         ; 1) Program Manager (starts with 'Program')
  9815.         ; 2) Clock  (starts with 'Clo' )
  9816.         WinCloseNot("Program", "Clo")
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.        See Also:
  9824.           EndSession, WinClose, WinHide, WinIconize, WinItemize, WinWaitClose
  9825.  
  9826.  
  9827.  
  9828.  
  9829.        WinConfig
  9830.        Returns WIN3 mode flags.
  9831.  
  9832.  
  9833.        Syntax:
  9834.         WinConfig ( )
  9835.  
  9836.        Parameters:
  9837.         (none)
  9838.  
  9839.        Returns:
  9840.         (i)          sum of Windows configuration bits.
  9841.  
  9842.  
  9843.        Returns Windows configuration information as a number, which is the
  9844.        sum of the following individual bits:
  9845.  
  9846.           1    Protected Mode
  9847.           2    80286 CPU
  9848.           4    80386 CPU
  9849.           8    80486 CPU
  9850.           16   Standard Mode
  9851.           32   Enhanced Mode
  9852.           64   8086 CPU
  9853.           128  80186 CPU
  9854.           256  Large PageFrame
  9855.           512  Small PageFrame
  9856.           1024 80x87 Installed
  9857.  
  9858.        You will need to use bitwise operators to extract the individual bits.
  9859.  
  9860.  
  9861.        Examples:
  9862.         cfg = WinConfig()
  9863.         If cfg & 32 Then Display(2, "Windows Mode", "Enhanced Mode")
  9864.         If cfg & 16 Then Display(2, "Windows Mode", "Standard Mode")
  9865.         If !(cfg & 1) Then Display(2, "Windows Mode", "Real Mode")
  9866.  
  9867.         cfg = WinConfig()
  9868.         If cfg & 1024 Then Display(2, "Math co-processor", "Yes")
  9869.         If !(cfg & 1024) Then Display(2, "Math co-processor", "No")
  9870.  
  9871.        See Also:
  9872.           NetGetCaps, WinMetrics, WinParmGet, WinResources
  9873.  
  9874.  
  9875.  
  9876.  
  9877.  
  9878.  
  9879.  
  9880.  
  9881.        WinExeName
  9882.        Returns the name of the executable file which created a specified
  9883.        window.
  9884.  
  9885.  
  9886.        Syntax:
  9887.         WinExeName (partial-winname)
  9888.  
  9889.        Parameters:
  9890.         (s) partial-winname     the initial part of, or an entire, window
  9891.                      name.
  9892.  
  9893.        Returns:
  9894.         (s)          name of the EXE file.
  9895.  
  9896.        Returns the name of the EXE file which created the first window found
  9897.        whose title matches "partial-winname".
  9898.  
  9899.        "Partial-winname" is the initial part of a window name, and may be a
  9900.        complete window name.  It is case-sensitive.  You should specify
  9901.        enough characters so that "partial-winname" matches only one existing
  9902.        window.
  9903.  
  9904.  
  9905.        Example:
  9906.         prog = WinExeName("WinCheck")
  9907.         WinClose("WinCheck")
  9908.         Delay(5)
  9909.         Run(prog, "")
  9910.  
  9911.  
  9912.        See Also:
  9913.           AppExist, AppWaitClose, Run, WinExist, WinGetActive, WinName
  9914.  
  9915.  
  9916.  
  9917.  
  9918.        WinExist
  9919.        Tells if specified window exists.
  9920.  
  9921.  
  9922.        Syntax:
  9923.         WinExist (partial-winname)
  9924.  
  9925.        Parameters:
  9926.         (s) partial-winname     the initial part of, or an entire, window
  9927.                      name.
  9928.  
  9929.        Returns:
  9930.         (i)          @TRUE if a matching window is found;
  9931.                      @FALSE if a matching window is not found.
  9932.  
  9933.  
  9934.  
  9935.  
  9936.  
  9937.        Note: The partial window name you give must match the initial portion
  9938.        of the window name (as appears in the title bar) exactly, including
  9939.        proper case (upper or lower) and punctuation.
  9940.  
  9941.  
  9942.        Example:
  9943.         If WinExist("Clock") == @FALSE Then RunIcon("Clock", "")
  9944.  
  9945.        See Also:
  9946.           AppExist, WinActivate, WinClose, WinExeName, WinGetActive,
  9947.           WinItemize, WinState
  9948.  
  9949.  
  9950.  
  9951.  
  9952.        WinGetActive
  9953.        Gets the title of the active window.
  9954.  
  9955.  
  9956.        Syntax:
  9957.         WinGetActive ( )
  9958.  
  9959.        Parameters:
  9960.         (none)
  9961.  
  9962.        Returns:
  9963.         (s)          title of active window.
  9964.  
  9965.        Use this function to determine which window is currently active.
  9966.  
  9967.  
  9968.        Example:
  9969.         currentwin = WinGetActive()
  9970.  
  9971.  
  9972.        See Also:
  9973.           WinActivate, WinExeName, WinItemize, WinName, WinPlaceGet,
  9974.           WinPosition, WinTitle
  9975.  
  9976.  
  9977.  
  9978.  
  9979.        WinHide
  9980.        Hides a window.
  9981.  
  9982.  
  9983.        Syntax:
  9984.         WinHide (partial-winname)
  9985.  
  9986.        Parameters:
  9987.         (s) partial-winname     either an initial portion of, or an entire
  9988.                      window name.  The most-recently used window whose title
  9989.                      matches the name will be hidden.
  9990.  
  9991.        Returns:
  9992.         (i)          @TRUE if a window was found to hide;
  9993.                      @FALSE if no windows were found.
  9994.  
  9995.  
  9996.  
  9997.  
  9998.  
  9999.  
  10000.        Use this function to hide windows.  The programs are still running
  10001.        when they are hidden.
  10002.  
  10003.        A partial-window name of "" (null string) hides the window making the
  10004.        current call to the WIL Interpreter.
  10005.  
  10006.  
  10007.        Example:
  10008.         Run("notepad.exe", "")
  10009.         WinHide("Notepad")
  10010.         Delay(3)
  10011.         WinShow("Notepad")
  10012.  
  10013.  
  10014.        See Also:
  10015.           RunHide, WinClose, WinIconize, WinPlace
  10016.  
  10017.  
  10018.  
  10019.  
  10020.        WinIconize
  10021.        Iconizes a window.
  10022.  
  10023.  
  10024.        Syntax:
  10025.         WinIconize (partial-winname)
  10026.  
  10027.        Parameters:
  10028.         (s) partial-winname     either an initial portion of, or an entire
  10029.                      window name.  The most-recently used window whose title
  10030.                      matches the name will be iconized.
  10031.  
  10032.        Returns:
  10033.         (i)          @TRUE if a window was found to iconize;
  10034.                      @FALSE if no windows were found.
  10035.  
  10036.        Use this function to turn a window into an icon at the bottom of the
  10037.        screen.
  10038.  
  10039.        A partial-window name of "" (null string) iconizes the current WIL
  10040.        Interpreter window.
  10041.  
  10042.  
  10043.        Example:
  10044.         Run("clock.exe", "")
  10045.         WinIconize("Clo")  ; partial window name used here
  10046.  
  10047.  
  10048.        See Also:
  10049.           IconArrange, RunIcon, WinClose, WinHide, WinPlace, WinShow, WinZoom
  10050.  
  10051.  
  10052.  
  10053.  
  10054.        WinItemize
  10055.        Returns a tab-delimited list of all open windows.
  10056.  
  10057.  
  10058.  
  10059.  
  10060.  
  10061.  
  10062.        Syntax:
  10063.         WinItemize ( )
  10064.  
  10065.        Parameters:
  10066.         (none)
  10067.  
  10068.        Returns:
  10069.         (s)          list of the titles of all open windows.
  10070.  
  10071.        This function compiles a list of all the open application windows'
  10072.        titles and separates the titles by tabs.  This is especially useful in
  10073.        conjunction with the ItemSelect function, which enables the user to
  10074.        choose an item from such a tab-delimited list.
  10075.  
  10076.        Note this behaves somewhat differently than FileItemize and
  10077.        DirItemize, which create space-delimited lists.  This is because
  10078.        window titles regularly contain embedded spaces.
  10079.  
  10080.  
  10081.        Example:
  10082.         ; Find a window
  10083.         allwins = WinItemize()
  10084.         htab = Num2Char(9)
  10085.         mywind = ItemSelect("Windows", allwins, htab)
  10086.         WinActivate(mywind)
  10087.  
  10088.  
  10089.        See Also:
  10090.           DirItemize, FileItemize, ItemSelect, TextSelect, WinClose,
  10091.           WinCloseNot, WinGetActive, WinName, WinPlaceGet, WinPosition
  10092.  
  10093.  
  10094.  
  10095.  
  10096.        WinMetrics
  10097.        Returns Windows system information.
  10098.  
  10099.  
  10100.        Syntax:
  10101.         WinMetrics (request#)
  10102.  
  10103.        Parameters:
  10104.         (i) request# see below.
  10105.  
  10106.        Returns:
  10107.         (i)          see below.
  10108.  
  10109.        The request# parameter determines what piece of information will be
  10110.        returned.
  10111.  
  10112.  
  10113.  
  10114.  
  10115.  
  10116.           Req# Return value
  10117.           -1   Number of colors supported by video driver
  10118.           0    Width of screen, in pixels
  10119.           1    Height of screen, in pixels
  10120.           2    Width of arrow on vertical scrollbar
  10121.           3    Height of arrow on horizontal scrollbar
  10122.           4    Height of window title bar
  10123.           5    Width of window border lines
  10124.           6    Height of window border lines
  10125.           7    Width of dialog box frame
  10126.           8    Height of dialog box frame
  10127.           9    Height of thumb box on scrollbar
  10128.           10   Width of thumb box on scrollbar
  10129.           11   Width of an icon
  10130.           12   Height of an icon
  10131.           13   Width of a cursor
  10132.           14   Height of a cursor
  10133.           15   Height of a one line menu bar
  10134.           16   Width of full screen window
  10135.           17   Height of a full screen window
  10136.           18   Height of Kanji window (Japanese)
  10137.           19   Is a mouse present (0 = No, 1 = Yes)
  10138.           20   Height of arrow on vertical scrollbar
  10139.           21   Width of arrow on horizontal scrollbar
  10140.           22   Is debug version of Windows running (0 = No, 1 = Yes)
  10141.           23   Are Left and Right mouse buttons swapped (0 = No, 1 = Yes)
  10142.           24   Reserved
  10143.           25   Reserved
  10144.           26   Reserved
  10145.           27   Reserved
  10146.           28   Minimum width of a window
  10147.           29   Minimum height of a window
  10148.           30   Width of bitmaps in title bar
  10149.           31   Height of bitmaps in title bar
  10150.           32   Width of sizeable window frame
  10151.           33   Height of sizeable window frame
  10152.           34   Minimum tracking width of a window
  10153.           35   Minimum tracking height of a window
  10154.  
  10155.        Example:
  10156.         mouse = "NO"
  10157.         If WinMetrics(19) == 1 Then mouse = "YES"
  10158.         Message("Is there a mouse installed?", mouse)
  10159.  
  10160.  
  10161.        See Also:
  10162.           Environment, MouseInfo, NetGetCaps, WinConfig, WinParmGet,
  10163.           WinResources
  10164.  
  10165.  
  10166.  
  10167.  
  10168.        WinName
  10169.        Returns the name of the window calling the WIL Interpreter.
  10170.  
  10171.  
  10172.  
  10173.  
  10174.  
  10175.  
  10176.        Syntax:
  10177.         WinName ( )
  10178.  
  10179.        Parameters:
  10180.         (none)
  10181.  
  10182.        Returns:
  10183.         (s)          window name.
  10184.  
  10185.        Returns the name of the window making the current call to the WIL
  10186.        Interpreter.
  10187.  
  10188.  
  10189.        Example:
  10190.         tab = Num2Char(9)
  10191.         allwins = WinItemize()
  10192.         win = ItemSelect("Close window", allwins, tab)
  10193.         If win == WinName() Then Goto nocando
  10194.         WinClose(win)
  10195.         Exit
  10196.         :nocando
  10197.         Message("Sorry", "I can't close myself")
  10198.  
  10199.  
  10200.        See Also:
  10201.           WinActivate, WinExeName, WinGetActive, WinItemize, WinTitle
  10202.  
  10203.  
  10204.  
  10205.  
  10206.        WinParmGet
  10207.        Returns system information.
  10208.  
  10209.  
  10210.        Syntax:
  10211.         WinParmGet (request#)
  10212.  
  10213.        Parameters:
  10214.         (i) request# see below.
  10215.  
  10216.        Returns:
  10217.         (s)          see below.
  10218.  
  10219.        Note: This function requires Windows 3.1 or higher.
  10220.  
  10221.        The request# parameter determines what piece of information will be
  10222.        returned.
  10223.  
  10224.           Req#   Meaning  Return value
  10225.  
  10226.  
  10227.  
  10228.  
  10229.  
  10230.           1 Beeping       0 = Off, 1 = On
  10231.           2 Mouse sensitivity   "threshold1 threshold2 speed"
  10232.           3 Border Width  Width in pixels
  10233.           4 Keyboard Speed Keyboard Repeat rate
  10234.           5 LangDriver    name of LANGUAGE.DLL
  10235.           6 Horiz. Icon Spacing Spacing in pixels
  10236.           7 Screen Save Timeout Timeout in seconds
  10237.           8 Is screen saver enabled  0 = No, 1 = Yes
  10238.           9 Desktop Grid size   Grid Size
  10239.           10Wallpaper BMP file  BMP file name
  10240.           11Desktop Pattern     Pattern codes (string of 8 space-delimited
  10241.           nums.)
  10242.           12Keyboard Delay Delay in milliseconds
  10243.           13Vertical Icon Spacing    Spacing in pixels
  10244.           14IconTitleWrap 0 = No, 1 = Yes
  10245.           15MenuDropAlign 0 = Right, 1 = Left
  10246.           16DoubleClickWidth    Allowable horiz. movement in pixels for
  10247.           DblClick
  10248.           17DoubleClickHeight   Allowable vert. movement in pixels for
  10249.           DblClick
  10250.           18DoubleClickSpeed    Max time in millisecs between clicks for
  10251.           DblClick
  10252.           19MouseButtonSwap     0 = Not swapped, 1 = swapped
  10253.           20Fast Task Switch    0 = Off, 1 = On
  10254.  
  10255.  
  10256.        Example:
  10257.         If WinParmGet(8) == 1 Then Message("", "Screen saver is active")
  10258.  
  10259.  
  10260.        See Also:
  10261.           Environment, MouseInfo, NetGetCaps, WinConfig, WinMetrics,
  10262.           WinParmSet, WinResources
  10263.  
  10264.  
  10265.  
  10266.  
  10267.        WinParmSet
  10268.        Sets system information.
  10269.  
  10270.  
  10271.        Syntax:
  10272.         WinParmSet (request#, new-value, ini-control)
  10273.  
  10274.        Parameters:
  10275.         (i) request# see WinParmGet
  10276.         (s) new-value see WinParmGet
  10277.         (i) ini-control    see below.
  10278.  
  10279.        Returns:
  10280.         (int)        previous value of the setting.
  10281.  
  10282.        Note: This function requires Windows 3.1 or higher.
  10283.  
  10284.        See WinParmSet for a list of valid request#'s and values.
  10285.  
  10286.  
  10287.  
  10288.  
  10289.  
  10290.        The "ini-control" parameter determines to what extent the value gets
  10291.        updated:
  10292.  
  10293.           0 Set system value in memory only for future reference
  10294.           1 Write new value to appropriate INI file
  10295.           2 Broadcast message to all applications informing them of new value
  10296.           3 Both 1 and 2
  10297.  
  10298.  
  10299.        Example:
  10300.         WinParmSet(9, "2", 3)   ; sets desktop grid size to 2
  10301.  
  10302.  
  10303.        See Also:
  10304.           WallPaper, WinParmGet
  10305.  
  10306.  
  10307.  
  10308.  
  10309.        WinPlace
  10310.        Places a window anywhere on the screen.
  10311.  
  10312.  
  10313.        Syntax:
  10314.         WinPlace (x-ulc, y-ulc, x-brc, y-brc, partial-winname)
  10315.  
  10316.        Parameters:
  10317.         (i) x-ulc    how far from the left of the screen to place the upper-
  10318.                      left corner (0-1000).
  10319.         (i) y-ulc    how far from the top of the screen to place the upper-
  10320.                      left corner (0-1000).
  10321.         (i) x-brc    how far from the left of the screen to place the bottom-
  10322.                      right corner (10-1000) or @NORESIZE.
  10323.         (i) y-brc    how far from the top of the screen to place the bottom-
  10324.                      right corner (10-1000) or @NORESIZE or @ABOVEICONS.
  10325.         (s) partial-winname     either an initial portion of, or an entire
  10326.                      window name.  The most-recently used window whose title
  10327.                      matches the name will be moved to the new position.
  10328.  
  10329.        Returns:
  10330.         (i)          @TRUE if a window was found to move;
  10331.                      @FALSE if no windows were found.
  10332.  
  10333.        Use this function to move windows on the screen.  (You cannot,
  10334.        however, move icons or windows that have been maximized to full
  10335.        screen.)
  10336.  
  10337.        The "x-ulc", "y-ulc", "x-brc", and "y-brc" parameters are based on a
  10338.        logical screen that is 1000 points wide by 1000 points high.
  10339.  
  10340.        You can move the window without changing the width and/or height by
  10341.        specifying @NORESIZE for the "x-brc" and/or "y-brc" parameters,
  10342.        respectively.
  10343.  
  10344.        You can fix the bottom of the window to sit just above the line of
  10345.        icons along the bottom of the screen by specifying a "y-brc" of
  10346.        @ABOVEICONS.
  10347.  
  10348.  
  10349.  
  10350.  
  10351.  
  10352.        Some sample parameters:
  10353.  
  10354.           Upper left quarter of the screen:  0, 0, 500, 500
  10355.           Upper right quarter:  500, 0, 1000, 500
  10356.           Center quarter:  250, 250, 750, 750
  10357.           Lower left eighth:  0, 750, 500, 1000
  10358.  
  10359.        A handy utility program is provided, called WININFO.EXE.  This program
  10360.        lets you take an open window that is sized and positioned the way you
  10361.        like it, and automatically create the proper WinPlace statement for
  10362.        you.  It puts the text into the Clipboard, from which you can paste it
  10363.        into your program.
  10364.  
  10365.        You'll need a mouse to use WinInfo.  While WinInfo is the active
  10366.        window, place the mouse over the window you wish to create the
  10367.        WinPlace statement for, and press the spacebar.  The new statement
  10368.        will be placed into the Clipboard.  Then press the Esc key to close
  10369.        WinInfo.
  10370.  
  10371.  
  10372.        Example:
  10373.         WinPlace(0, 0, 200, 200, "Clock")
  10374.  
  10375.  
  10376.        See Also:
  10377.           WinArrange, WinHide, WinIconize, WinPlaceSet, WinPosition, WinShow,
  10378.           WinZoom
  10379.  
  10380.  
  10381.  
  10382.  
  10383.        WinPlaceGet
  10384.        Returns window coordinates.
  10385.  
  10386.  
  10387.        Syntax:
  10388.         WinPlaceGet (win-type, partial-winname)
  10389.  
  10390.        Parameters:
  10391.         (i) win-type @ICON, @NORMAL, or @ZOOMED
  10392.         (s) partial-winname     the initial part of, or an entire, window
  10393.                      name.
  10394.  
  10395.        Returns:
  10396.         (s)          window coordinates (see below).
  10397.  
  10398.        This function returns the coordinates for an iconized, normal, or
  10399.        zoomed window.
  10400.  
  10401.        "Partial-winname" is the initial part of a window name, and may be a
  10402.        complete window name.  It is case-sensitive.  You should specify
  10403.        enough characters so that "partial-winname" matches only one existing
  10404.        window.  If it matches more than one window, the most recently
  10405.        accessed window which it matches will be used.
  10406.  
  10407.        The returned value is a string of either 2 or 4 numbers, as follows:
  10408.  
  10409.  
  10410.  
  10411.  
  10412.  
  10413.           Iconic windows   "x y"     (upper left corner of the icon)
  10414.           Normal windows   "upper-x upper-y lower-x lower-y"
  10415.           Zoomed windows   "x y"     (upper left corner of the window)
  10416.  
  10417.        All coordinates are relative to a virtual 1000x1000 screen.
  10418.  
  10419.  
  10420.        Examples:
  10421.         Run("clock.exe", "")
  10422.         pos = WinPlaceGet(@NORMAL, "Clock")
  10423.         Delay(2)
  10424.         WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  10425.         Delay(2)
  10426.         WinPlaceSet(@NORMAL, "Clock", pos)
  10427.  
  10428.  
  10429.        See Also:
  10430.           WinGetActive, WinItemize, WinPlaceSet, WinPosition, WinState
  10431.  
  10432.  
  10433.  
  10434.  
  10435.        WinPlaceSet
  10436.        Sets window coordinates.
  10437.  
  10438.  
  10439.        Syntax:
  10440.         WinPlaceSet (win-type, partial-winname, position-string)
  10441.  
  10442.        Parameters:
  10443.         (i) win-type @ICON, @NORMAL, or @ZOOMED
  10444.         (s) partial-winname     the initial part of, or an entire, window
  10445.                      name.
  10446.         (s) position-string     window coordinates (see below).
  10447.  
  10448.        Returns:
  10449.         (s)          previous coordinates.
  10450.  
  10451.        This function sets the coordinates for an iconized, normal, or zoomed
  10452.        window.  The window does not have to be in the desired state to set
  10453.        the coordinates; for example, you can set the iconized position for a
  10454.        normal window so that when the window is subsequently iconized, it
  10455.        will go to the coordinates that you've set.
  10456.  
  10457.        "Partial-winname" is the initial part of a window name, and may be a
  10458.        complete window name.  It is case-sensitive.  You should specify
  10459.        enough characters so that "partial-winname" matches only one existing
  10460.        window.  If it matches more than one window, the most recently
  10461.        accessed window which it matches will be used.
  10462.  
  10463.        "Position-string" is a string of either 2 or 4 numbers, as follows:
  10464.  
  10465.           Iconic windows   "x y"     (upper left corner of the icon)
  10466.           Normal windows   "upper-x upper-y lower-x lower-y"
  10467.           Zoomed windows   "x y"     (upper left corner of the window)
  10468.  
  10469.        All coordinates are relative to a virtual 1000x1000 screen.
  10470.  
  10471.  
  10472.  
  10473.  
  10474.  
  10475.  
  10476.        Examples:
  10477.         WinPlaceSet(@ICON, "Clock", "10 950")
  10478.  
  10479.         WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  10480.  
  10481.         WinPlaceSet(@ZOOMED, "Clock", "-5 -5")
  10482.  
  10483.  
  10484.        See Also:
  10485.           IconArrange, WinActivate, WinArrange, WinPlace, WinPlaceGet,
  10486.           WinState
  10487.  
  10488.  
  10489.  
  10490.  
  10491.        WinPosition
  10492.        Returns Window position.
  10493.  
  10494.  
  10495.        Syntax:
  10496.         WinPosition (partial-winname)
  10497.  
  10498.        Parameters:
  10499.         (s) partial-winname     the initial part of, or an entire, window
  10500.                      name.
  10501.  
  10502.        Returns:
  10503.         (s)          window coordinates, delimited by commas.
  10504.  
  10505.  
  10506.        Returns the current window position information for the selected
  10507.        window.  It returns 4 comma-separated numbers (see WinPlace for
  10508.        details).
  10509.  
  10510.  
  10511.        Example:
  10512.         Run("clock.exe", "")       ; start Clock
  10513.         WinPlace(0,0,300,300, "Clock")    ; place Clock
  10514.         pos = WinPosition("Clock") ; save position
  10515.         delay(2)
  10516.         WinPlace(200,200,300,300, "Clock")     ; move Clock
  10517.         delay(2)
  10518.         WinPlace(%pos%, "Clock")   ; restore Clock
  10519.  
  10520.  
  10521.        See Also:
  10522.           WinGetActive, WinItemize, WinPlace, WinPlaceGet, WinState
  10523.  
  10524.  
  10525.  
  10526.  
  10527.        WinResources
  10528.        Returns information on available memory and resources.
  10529.  
  10530.  
  10531.  
  10532.  
  10533.  
  10534.  
  10535.        Syntax:
  10536.         WinResources (request#)
  10537.  
  10538.        Parameters:
  10539.         (i) request# see below
  10540.  
  10541.        Returns:
  10542.         (i)          see below.
  10543.  
  10544.        The value of request# determined the piece of information returned.
  10545.  
  10546.           Req#   Return value
  10547.  
  10548.           0  Total available memory, in bytes
  10549.           1  Theoretical maximum available memory, in bytes
  10550.           2  Percent of free system resources (lower of GDI and USER)
  10551.           3  Percent of free GDI resources
  10552.           4  Percent of free USER resources
  10553.  
  10554.  
  10555.        Example:
  10556.         mem = WinResources(0)
  10557.         Message("Available memory", "%mem% bytes")
  10558.  
  10559.  
  10560.        See Also:
  10561.           WinConfig, WinMetrics, WinParmGet
  10562.  
  10563.  
  10564.  
  10565.  
  10566.        WinShow
  10567.        Shows a window in its "normal" state.
  10568.  
  10569.  
  10570.        Syntax:
  10571.         WinShow (partial-winname)
  10572.  
  10573.        Parameters:
  10574.         (s) partial-winname     either an initial portion of, or an entire
  10575.                      window name.  The most-recently used window whose title
  10576.                      matches the name will be shown.
  10577.  
  10578.        Returns:
  10579.         (i)          @TRUE if a window was found to show;
  10580.                      @FALSE if no windows were found.
  10581.  
  10582.        Use this function to restore a window to its "normal" size and
  10583.        position.
  10584.  
  10585.        A partial-window name of "" (null string) restores the current WIL
  10586.        interpreter window.
  10587.  
  10588.  
  10589.  
  10590.  
  10591.  
  10592.  
  10593.        Example:
  10594.         RunZoom("notepad.exe", "")
  10595.         ; other processing...
  10596.         WinShow("Notepad")
  10597.  
  10598.  
  10599.        See Also:
  10600.           WinArrange, WinHide, WinIconize, WinZoom
  10601.  
  10602.  
  10603.  
  10604.  
  10605.        WinState
  10606.        Returns the current state of a window.
  10607.  
  10608.  
  10609.        Syntax:
  10610.         WinState (partial-winname)
  10611.  
  10612.        Parameters:
  10613.         (s) partial-winname     the initial part of, or an entire, window
  10614.                      name.
  10615.  
  10616.        Returns:
  10617.         (i)          window state (see below).
  10618.  
  10619.        "Partial-winname" is the initial part of a window name, and may be a
  10620.        complete window name.  It is case-sensitive.  You should specify
  10621.        enough characters so that "partial-winname" matches only one existing
  10622.        window.  If it matches more than one window, the most recently
  10623.        accessed window which it matches will be used.
  10624.  
  10625.        Possible return values are as follows.
  10626.  
  10627.           Value Symbolic name   Meaning
  10628.  
  10629.           -1                Specified window exists, but is hidden
  10630.           0                 Specified window does not exist
  10631.           1     @ICON       Specified window is iconic (minimized)
  10632.           2     @NORMAL     Specified window is a normal window
  10633.           3     @ZOOMED     Specified window is zoomed (maximized)
  10634.  
  10635.  
  10636.        Example:
  10637.         If WinState("Notepad") == @ICON Then WinShow("Notepad")
  10638.  
  10639.  
  10640.        See Also:
  10641.           Run, WinExist, WinGetActive, WinHide, WinIconize, WinItemize,
  10642.           WinPlace, WinPlaceGet, WinPlaceSet, WinPosition, WinShow, WinZoom
  10643.  
  10644.  
  10645.  
  10646.  
  10647.        WinTitle
  10648.        Changes the title of a window.
  10649.  
  10650.  
  10651.  
  10652.  
  10653.  
  10654.  
  10655.        Syntax:
  10656.         WinTitle (partial-winname, new-name)
  10657.  
  10658.        Parameters:
  10659.         (s) partial-winname     either an initial portion of, or an entire
  10660.                      window name.  The most-recently used window whose title
  10661.                      matches the name will be shown.
  10662.         (s) new-name the new name of the window.
  10663.  
  10664.        Returns:
  10665.         (i)          @TRUE if a window was found to rename;
  10666.                      @FALSE if no windows were found.
  10667.  
  10668.        Use this function to change a window's title.
  10669.  
  10670.        A partial-window name of "" (null string) refers to the current WIL
  10671.        interpreter window.
  10672.  
  10673.        Warning:  Some applications may rely upon their window's title staying
  10674.        the same!  Therefore, the WinTitle function should be used with
  10675.        caution and adequate testing.
  10676.  
  10677.  
  10678.        Example:
  10679.         ; Capitalize title of window
  10680.         htab = Num2Char(9)
  10681.         allwinds = WinItemize()
  10682.         mywin = ItemSelect("Uppercase Windows", allwinds, htab)
  10683.         WinTitle(mywin, StrUpper(mywin))
  10684.         Drop(htab, allwinds, mywin)
  10685.  
  10686.  
  10687.        See Also:
  10688.           WinGetActive, WinItemize, WinName
  10689.  
  10690.  
  10691.  
  10692.  
  10693.        WinVersion
  10694.        Provides the version number of the current Windows system.
  10695.  
  10696.  
  10697.        Syntax:
  10698.         WinVersion (level)
  10699.  
  10700.        Parameters:
  10701.         (i) level    either @MAJOR or @MINOR.
  10702.  
  10703.        Returns:
  10704.         (i)          either major or minor part of the Windows version
  10705.                      number.
  10706.  
  10707.        Use this command to determine which version of Windows is currently
  10708.        running.
  10709.  
  10710.  
  10711.  
  10712.  
  10713.  
  10714.        @MAJOR returns the integer part of the Windows version number; i.e.
  10715.        1.0, 2.11, 3.0, etc.
  10716.  
  10717.        @MINOR returns the decimal part of the Windows version number; i.e.
  10718.        1.0, 2.11, 3.0, etc.
  10719.  
  10720.  
  10721.        Example:
  10722.         minorver = WinVersion(@MINOR)
  10723.         majorver = WinVersion(@MAJOR)
  10724.         Message("Windows Version", StrCat(majorver, ".", minorver))
  10725.  
  10726.  
  10727.        See Also:
  10728.           Version, DOSVersion
  10729.  
  10730.  
  10731.  
  10732.  
  10733.        WinWaitClose
  10734.        Suspends the WIL program execution until a specified window has been
  10735.        closed.
  10736.  
  10737.  
  10738.        Syntax:
  10739.         WinWaitClose (partial-winname)
  10740.  
  10741.        Parameters:
  10742.         (s) partial-winname     either an initial portion of, or an entire
  10743.                      window name.  WinWaitClose suspends execution until all
  10744.                      matching windows have been closed.
  10745.  
  10746.        Returns:
  10747.         (i)          @TRUE if at least one window was found to wait for;
  10748.                      @FALSE if no windows were found.
  10749.  
  10750.        Use this function to suspend the WIL program's execution until the
  10751.        user has finished using a given window and has manually closed it.
  10752.  
  10753.  
  10754.        Example:
  10755.         Run("clock.exe", "")
  10756.         Display(4, "Note", "Close Clock to continue")
  10757.         WinWaitClose("Clock")
  10758.         Message("Continuing...", "Clock closed")
  10759.  
  10760.  
  10761.        See Also:
  10762.           Delay, RunWait, WinExist, Yield
  10763.  
  10764.  
  10765.  
  10766.  
  10767.        WinZoom
  10768.        Maximizes a window to full-screen.
  10769.  
  10770.  
  10771.  
  10772.  
  10773.  
  10774.  
  10775.        Syntax:
  10776.         WinZoom (partial-winname)
  10777.  
  10778.        Parameters:
  10779.         (s) partial-winname     either an initial portion of, or an entire
  10780.                      window name.  The most-recently used window whose title
  10781.                      matches the name will be shown.
  10782.  
  10783.        Returns:
  10784.         (i)          @TRUE if a window was found to zoom;
  10785.                      @FALSE if no windows were found.
  10786.  
  10787.        Use this function to "zoom" windows to full screen size.
  10788.  
  10789.        A partial-window name of "" (null string) zooms the current WIL
  10790.        interpreter window.
  10791.  
  10792.  
  10793.        Example:
  10794.         Run("notepad.exe", "")
  10795.         WinZoom("Notepad")
  10796.         Delay(3)
  10797.         WinShow("Notepad")
  10798.  
  10799.  
  10800.        See Also:
  10801.           RunZoom, WinHide, WinIconize, WinPlace, WinShow
  10802.  
  10803.  
  10804.  
  10805.  
  10806.        Yield
  10807.        Provides time for other windows to do processing.
  10808.  
  10809.  
  10810.        Syntax:
  10811.         Yield
  10812.  
  10813.        Parameters:
  10814.         (none)
  10815.  
  10816.        Returns:
  10817.         (not applicable)
  10818.  
  10819.        Use this command to give other running windows time to process.  This
  10820.        command will allow each open window to process 20 or more messages.
  10821.  
  10822.  
  10823.        Example:
  10824.         ; run Excel and give it some time to start up
  10825.         sheet = AskLine ("Excel", "File to run:", "")
  10826.         Run("excel.exe", sheet)
  10827.         Yield
  10828.         Yield
  10829.         Yield
  10830.  
  10831.  
  10832.  
  10833.  
  10834.  
  10835.  
  10836.        See Also:
  10837.           Delay, Exclusive
  10838.  
  10839.  
  10840.  
  10841.  
  10842.  
  10843.  
  10844.                                     DIALOG BOXES
  10845.  
  10846.        For each dialog box, you must first create a template file, with a
  10847.        (recommended) WDG extension, which will identify the structure of the
  10848.        dialog box, as well as the variables used by it.  Unlike the other WIL
  10849.        functions, you do not actually pass variables to DialogBox as
  10850.        parameters.  However, the DialogBox function does indeed have the
  10851.        ability to manipulate, and even create, variables.  If you are
  10852.        familiar with programming, you may think of DialogBox as a subroutine,
  10853.        and all the variables it uses as being global.
  10854.  
  10855.        Let's start with a simple example.  Suppose we want to write a WIL
  10856.        program which starts up Notepad, with two options which can be
  10857.        selected at runtime:
  10858.  
  10859.        Here's what the template file will look like:
  10860.  
  10861.         [zoom+1Start editor zoomed]
  10862.         [backup+1Save backup of file]
  10863.  
  10864.        It is an ordinary ASCII file.
  10865.  
  10866.        Some explanation is in order.  First, note the square brackets.  Each
  10867.        element in a WDG file is enclosed in brackets; in this case, there are
  10868.        two distinct elements.  Next, notice that the first items that appear
  10869.        inside the brackets are variable names -- in this case, zoom and
  10870.        backup.  Immediately following the variable name is a plus sign (+),
  10871.        which identifies the elements as being check boxes.  After the +
  10872.        symbol is the number 1, which represents the value that will be
  10873.        assigned to the variable if the box gets checked.  Note that there is
  10874.        no space before or after the + symbol.  Finally, we have the text
  10875.        which will be displayed next to the check box.
  10876.  
  10877.        Now, let's create the WIL program file which will use this WDG
  10878.        template:
  10879.  
  10880.         file = ItemSelect("", FileItemize("*.*"), " ")
  10881.         DialogBox("Edit a file", "edit.wdg")
  10882.         If backup == 0 Then Goto nobackup
  10883.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10884.         FileCopy(file, filebackupname, @TRUE)
  10885.         :nobackup
  10886.         If zoom == 1 Then Run("notepad.exe", file)
  10887.         If zoom == 1 Then RunZoom("notepad.exe", file)
  10888.  
  10889.        The WDG template file should be in the current directory or in a
  10890.        directory on your path; otherwise, you must give a complete path
  10891.        specification for it when it appears in the DialogBox statement.
  10892.  
  10893.        Now, run the WIL program.  See how the lines in the template file got
  10894.        translated to fields in the dialog box.  Also notice the two buttons
  10895.        that were added at the bottom -- OK and Cancel.  Cancel terminates the
  10896.        WIL program entirely.
  10897.  
  10898.        You may want to try running this with various combinations of boxes
  10899.        checked, just to confirm that it works properly.  It should.
  10900.  
  10901.  
  10902.  
  10903.  
  10904.  
  10905.        Now, look again at the WIL program.  Notice how the variables zoom and
  10906.        backup do not appear until after the DialogBox statement.  In essence,
  10907.        these variables are created by the WDG template, and initialized with
  10908.        values of 0.  If the user checks a box, the variable associated with
  10909.        that box is given the value which appears next to the + symbol in the
  10910.        template.  So, if the first box is checked, then zoom will have a
  10911.        value of 1 after the DialogBox statement is executed.  If it remains
  10912.        un-checked, it will still have a value of 0.  These values can then be
  10913.        used in your WIL program, as we have done above.
  10914.  
  10915.        Suppose that you want a box to be checked, by default.  All you need
  10916.        to do is to assign a non-zero value to the corresponding variable
  10917.        before you execute the DialogBox statement.  For example:
  10918.  
  10919.         file = ItemSelect("", FileItemize("*.*"), " ")
  10920.         zoom = 1
  10921.         DialogBox("Edit a file", "edit.wdg")
  10922.         If backup == 0 Then Goto nobackup
  10923.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10924.         FileCopy(file, filebackupname, @TRUE)
  10925.         :nobackup
  10926.         If zoom == 0 Then Run("notepad.exe", file)
  10927.         If zoom == 1 Then RunZoom("notepad.exe", file)
  10928.  
  10929.        When you run it this time, the first box will already be checked,
  10930.        because we first assigned a value of 1 to the variable zoom.  The
  10931.        variable will still have a value of 1 after the DialogBox statement is
  10932.        executed -- unless the user un-checks the box, in which case it will
  10933.        have a value of 0.  The variable associated with an unchecked box is
  10934.        always equal to 0; the variable associated with a checked box is equal
  10935.        to the value you specify for that box.  For the most part, you would
  10936.        be fine simply using a value of 1 to indicate a checked box.
  10937.  
  10938.        You can change the layout of the WDG template to suit your taste.  For
  10939.        example, this:
  10940.  
  10941.         [zoom+1Start editor zoomed]   [backup+1Save backup of file]
  10942.  
  10943.        would put the two check boxes side by side.  However, you may not put
  10944.        tab characters in a template file, so be sure to use spaces instead
  10945.        (unless your editor can convert tabs to spaces).  Also, template files
  10946.        are limited to 20 lines, and to the first 60 columns
  10947.  
  10948.        The next element which you can use in a dialog box is the radio
  10949.        button.  Whereas you can have several check boxes checked at one time,
  10950.        the radio button gets its name from the five-button car radio, which
  10951.        can only have one station selected at a time.  You can have more than
  10952.        one group of radio buttons, but only one button in each group may be
  10953.        "pressed."  Therefore, this is ideal for situations where the user
  10954.        must make a choice from multiple alternatives:
  10955.  
  10956.        Here's a group of four radio buttons:
  10957.  
  10958.         [editor^1Notepad]       [editor^2WinEdit]
  10959.         [editor^3Write]         [editor^4WinWord]
  10960.  
  10961.  
  10962.  
  10963.  
  10964.  
  10965.        Let's look at how these are different from check boxes.  First, the
  10966.        symbol which identifies a radio button is a caret (^), instead of a +.
  10967.        Second, each of the buttons has the same variable name (editor).  And
  10968.        third, each button has a unique value following the ^ symbol.
  10969.  
  10970.        This should make sense if you consider what we are trying to
  10971.        accomplish: we want to obtain a value for the variable editor.  The
  10972.        user has four programs to choose from, and he must choose one, and
  10973.        only one.  As you have probably guessed, the value associated with the
  10974.        button which the user "pushes" will be assigned to editor.
  10975.  
  10976.        Let's add this to our existing EDIT.WDG template:
  10977.  
  10978.         [zoom+1Start editor zoomed]
  10979.         [backup+1Save backup of file]
  10980.         [editor^1Notepad]       [editor^2WinEdit]
  10981.         [editor^3Write]         [editor^4WinWord]
  10982.  
  10983.        and expand our WIL program to take advantage of it:
  10984.  
  10985.         file = ItemSelect("", FileItemize("*.*"), " ")
  10986.         zoom = 1
  10987.         DialogBox("Edit a file", "edit.wdg")
  10988.         If backup == 0 Then Goto nobackup
  10989.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10990.         FileCopy(file, filebackupname, @TRUE)
  10991.         :nobackup
  10992.         If zoom == 0 Then runcmd = "Run"
  10993.         If zoom == 1 Then runcmd = "RunZoom"
  10994.         If editor == 1 Then %runcmd%("notepad.exe", file)
  10995.         If editor == 2 Then %runcmd%("winedit.exe", file)
  10996.         If editor == 3 Then %runcmd%("write.exe", file)
  10997.         If editor == 4 Then %runcmd%("winword.exe", file)
  10998.  
  10999.        (We're using the variable runcmd to avoid having to code eight
  11000.        separate Run and RunZoom statements.  Pretty clever, isn't it.)
  11001.  
  11002.        Look at how we are testing the value of editor to determine which
  11003.        program to run.  When the DialogBox statement is executed, the first
  11004.        radio button in each group is selected, regardless of its value.  In
  11005.        this case, the first button appearing in the template, in the editor
  11006.        group, has a value of 1, so, unless the user selects a different
  11007.        button, the variable editor will have a value of 1 after DialogBox
  11008.        finishes, and Notepad will be run.  If the user selects the WinEdit
  11009.        button, editor will have a value of 2 , and Winedit will be run.
  11010.  
  11011.        Another important element which you can use in your templates is the
  11012.        file selection list box, which combines the functionality of
  11013.        DirItemize, FileItemize, and ItemSelect.  It has the following form:
  11014.  
  11015.         [file\                       ]
  11016.         [file\                       ]
  11017.         [file\                       ]
  11018.         [file\                       ]
  11019.         [file\                       ]
  11020.  
  11021.  
  11022.  
  11023.  
  11024.  
  11025.        Here, file is the variable name (you can use another name instead of
  11026.        file), and the backslash (\) is the symbol which identifies this as a
  11027.        file list element.  The amount of space between the \ symbol and the
  11028.        right bracket will determine the width of the file selection list box.
  11029.        And the number of occurrences of this element (each must have an
  11030.        identical name) will determine the height of the list box.
  11031.  
  11032.        Let's add this to our template:
  11033.  
  11034.         [zoom+1Start editor zoomed]
  11035.         [backup+1Save backup of file]
  11036.         [editor^1Notepad]       [editor^2WinEdit]
  11037.         [editor^3Write]         [editor^4WinWord]
  11038.         [file\                       ]
  11039.         [file\                       ]
  11040.         [file\                       ]
  11041.         [file\                       ]
  11042.         [file\                       ]
  11043.  
  11044.        and revise our program:
  11045.  
  11046.         zoom = 1
  11047.         DialogBox("Edit a file", "edit.wdg")
  11048.         If backup == 0 Then Goto nobackup
  11049.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  11050.         FileCopy(file, filebackupname, @TRUE)
  11051.         :nobackup
  11052.         If zoom == 0 Then runcmd = "Run"
  11053.         If zoom == 1 Then runcmd = "RunZoom"
  11054.         If editor == 1 Then %runcmd%("notepad.exe", file)
  11055.         If editor == 2 Then %runcmd%("winedit.exe", file)
  11056.         If editor == 3 Then %runcmd%("write.exe", file)
  11057.         If editor == 4 Then %runcmd%("winword.exe", file)
  11058.  
  11059.        All we did was remove the first line from the earlier example, which
  11060.        used FileItemize and ItemSelect to retrieve a file name.
  11061.  
  11062.        By default, the file selection list box uses *.* as a file mask.  If
  11063.        you want to limit the selection to, say, DOC files, assign a value to
  11064.        the appropriate variable before executing the DialogBox statement:
  11065.  
  11066.         file = "*.doc"
  11067.         DialogBox("Edit a file", "edit.wdg")
  11068.  
  11069.        Another element, the file mask edit box, allows the user to change the
  11070.        file mask interactively.  It's format is:
  11071.  
  11072.         [file#        ]
  11073.  
  11074.        Where the variable name, in this case file, must be the same as the
  11075.        one used in the file selection list box, and is followed by a number
  11076.        sign (#).  If the user enters a valid wild card mask in the file mask
  11077.        edit box, the file display in the file selection list box will be
  11078.        updated accordingly.  For example, if DOC files are currently shown,
  11079.        and the user types *.TXT, the display will change to show TXT files.
  11080.  
  11081.  
  11082.  
  11083.  
  11084.  
  11085.        You can optionally display the current directory (whose contents are
  11086.        being listed) by including an additional element in the template:
  11087.  
  11088.         [file$                       ]
  11089.  
  11090.        This is identical to the file list element, except the symbol for the
  11091.        directory element is a dollar sign ($).  The variable name must be the
  11092.        same as the one used in the file selection list box:
  11093.  
  11094.         [file$                       ]
  11095.             File mask [file#         ]
  11096.         [file\                       ]
  11097.         [file\                       ]
  11098.         [file\                       ]
  11099.         [file\                       ]
  11100.         [file\                       ]
  11101.  
  11102.        Note that we have included the descriptive text "File mask" next to
  11103.        the file mask edit box.  You may place explanatory text anywhere in
  11104.        the template file, as long as it doesn't appear inside square
  11105.        brackets.
  11106.  
  11107.        You can also display a WIL variable in your dialog box by using an
  11108.        element of this form:
  11109.  
  11110.         [varname$]
  11111.  
  11112.        Where the name of the variable is followed by a dollar sign ($).  The
  11113.        WIL Interpreter will replace this with the current value of the
  11114.        variable.
  11115.  
  11116.        Finally, we have the edit box, which allows us to assign user-supplied
  11117.        text to a variable.  The edit box element has the form:
  11118.  
  11119.         [input#                      ]
  11120.  
  11121.        The variable name (in this case, input) is followed a number sign (#),
  11122.        and the width of the area between the brackets determines the width of
  11123.        the edit box which gets displayed.  Whatever the user types in the box
  11124.        gets assigned to the associated variable.  Here is a sample RENAME.WDG
  11125.        template:
  11126.  
  11127.         Select file to be renamed
  11128.         [oldname$                         ]
  11129.         [oldname\                         ]
  11130.         [oldname\                         ]
  11131.         [oldname\                         ]
  11132.         [oldname\                         ]
  11133.  
  11134.         Type new name for the file
  11135.         [newname#                         ]
  11136.  
  11137.        Which could be used with this program:
  11138.  
  11139.         DialogBox("File Rename", "rename.wdg")
  11140.         FileRename(oldname, newname)
  11141.  
  11142.  
  11143.  
  11144.  
  11145.  
  11146.        You will have noticed that there are two symbols -- $ and # -- which
  11147.        have dual meanings, depending on whether or not there is a file list
  11148.        selection variable in the template with the same name.  The three file
  11149.        elements -- [file\], [file$], and [file#] -- are a "set", and share a
  11150.        common variable name.  All other variables in your template should
  11151.        have unique names.
  11152.  
  11153.  
  11154.  
  11155.  
  11156.  
  11157.  
  11158.                                      APPENDIX A
  11159.  
  11160.                                 Predefined Constants
  11161.  
  11162.        WIL provides you with a number of predefined integer constants to help
  11163.        make your WIL programs more mnemonic:
  11164.  
  11165.  
  11166.        Logical Conditions                    String Handling
  11167.        @FALSE                                @FWDSCAN
  11168.        @NO                                   @BACKSCAN
  11169.        @OFF
  11170.        @TRUE                                 Menu Handling
  11171.        @YES                                  @ENABLE
  11172.        @ON                                   @DISABLE
  11173.                                              @UNCHECK
  11174.        Window Arranging                      @CHECK
  11175.        @NORESIZE
  11176.        @ABOVEICONS                           System Control
  11177.        @STACK                                @MAJOR
  11178.        @ARRANGE                              @MINOR
  11179.        @TITLE
  11180.        @ROWS                                 Error Handling
  11181.        @COLUMNS                              @CANCEL
  11182.                                              @NOTIFY
  11183.                                              @OFF
  11184.  
  11185.                                              Keyboard Status
  11186.                                              @SHIFT
  11187.                                              @CTRL
  11188.  
  11189.                                              Debug Control
  11190.                                              @PARSEONLY
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.  
  11197.  
  11198.                                      APPENDIX B
  11199.  
  11200.                                        Errors
  11201.  
  11202.        If the current error mode is @CANCEL (the default), any WIL errors
  11203.        encountered while processing a WIL program cause the item to be
  11204.        canceled with an error message.
  11205.  
  11206.  
  11207.  
  11208.  
  11209.        Minor Errors
  11210.        Minor errors are ignored if the current error mode has been set to
  11211.        @OFF.  If the error mode is @NOTIFY the user has the option of
  11212.        continuing with the WIL program or canceling it.
  11213.  
  11214.        1006 File Copy/Move: No matching files found
  11215.        1017 File Delete: No matching files found
  11216.        1018 File Delete: Delete Failed
  11217.        1024 File Rename: No matching files found
  11218.        1025 File Rename: Rename failed
  11219.        1028 LogDisk: Requested drive not online
  11220.        1029 DirMake: Dir not created
  11221.        1030 DirRemove: Dir not removed
  11222.        1031 DirChange: Dir not found/changed
  11223.        1039 WinClose: Window not found
  11224.        1040 WinHide: Window not found
  11225.        1041 WinIconize: Window not found
  11226.        1042 WinZoom: Window not found
  11227.        1043 WinShow: Window not found
  11228.        1044 WinPlace: Window not found
  11229.        1045 WinActivate: Window not found
  11230.        1077 FileOpen: Open failed
  11231.        1119 WinPosition: Window not found
  11232.        1121 WinTitle: Window not found
  11233.        1100 StrIndex/StrScan 3rd parameter out of bounds
  11234.  
  11235.  
  11236.  
  11237.  
  11238.  
  11239.        1900 WinExec 0: Out of Memory
  11240.        1902 WinExec 2: File Not Found
  11241.        1903 WinExec 3: Path Not Found
  11242.        1905 WinExec 5: Attempt to dynlink to a task
  11243.        1906 WinExec 6: Lib requires data segs for each task
  11244.        1910 WinExec 10: Incorrect Windows Version
  11245.        1911 WinExec 11: Invalid EXE file
  11246.        1912 WinExec 12: Cannot run OS/2 application
  11247.        1913 WinExec 12: Cannot run DOS4.0 application
  11248.        1914 WinExec 14: Unknown EXE type
  11249.        1915 WinExec 15: Attempt to run old EXE in protect mode
  11250.        1916 WinExec 16: Attempted 2nd EXE with multiple writeable datasegs
  11251.        1917 WinExec 17: Nonshareable DLLs already in use
  11252.        1918 WinExec 18: App marked for protected mode only
  11253.        1932 WinExec: Undefined Error
  11254.  
  11255.  
  11256.  
  11257.        Moderate Errors
  11258.        If the error mode is @NOTIFY or @OFF, the user has the option of
  11259.        continuing with the WIL program or canceling it.
  11260.  
  11261.        2001 SendKey: Illegal Parameters
  11262.        2002 File Copy/Move: 'From' file illegal
  11263.        2003 File Copy/Move: 'To'   file illegal
  11264.        2004 File Copy/Move: Cannot copy/move wildcards into fixed root
  11265.        2005 File Copy/Move: Cannot copy/move wildcards into fixed extension
  11266.        2007 File Move: Unable to rename source file
  11267.        2015 File Move:  Unable to remove source file
  11268.        2016 File Delete: File name illegal
  11269.        2019 File Rename: 'From' file illegal
  11270.        2020 File Rename: 'To' file illegal
  11271.        2021 File Rename: Attempt to rename across drive boundary. - Use MOVE
  11272.             instead.
  11273.        2022 File Rename: Cannot rename wildcards into a fixed filename root
  11274.        2023 File Rename: Cannot rename wildcards into a fixed filename
  11275.             extension
  11276.        2038 WinCloseNot Function Syntax error
  11277.        2045 WinActivate: Window not found
  11278.        2058 StrCat function syntax error
  11279.        2060 Average function syntax error
  11280.        2093 Dialog Box: Bad Filespec, using *.*
  11281.        2112 FileSize: File Not Found
  11282.        2118 FileCopy/Move: Destination file same as source
  11283.  
  11284.  
  11285.  
  11286.        Fatal Errors
  11287.        Fatal errors cause the current WIL program to be canceled with an
  11288.        error message, regardless of the error mode in effect.  (We show the
  11289.        error codes here for consistency, but in practice you will never be
  11290.        able to call LastError after a fatal error.)
  11291.  
  11292.        3008 File Copy/Move: 'From' file open error
  11293.        3009 SendKey: Could not open DEBUG text file
  11294.        3010 SendKey: Could not install hook - Already Active??
  11295.        3011 File Copy/Move: 'From' file length error
  11296.  
  11297.  
  11298.  
  11299.  
  11300.  
  11301.        3012 File Copy/Move: No room left on disk.  Out of space??
  11302.        3013 File Copy/Move: 'To' file open error
  11303.        3014 File Copy/Move: I/O Error
  11304.        3015 File Move:  Unable to remove source file
  11305.        3026 LogDisk: Illegal disk drive
  11306.        3027 LogDisk: DOS reports no disks!!  ???
  11307.        3032 GoTo unable to lock memory for batch file
  11308.        3033 GoTo label not found
  11309.        3034 Clipboard owned by another app.  Cannot open.
  11310.        3035 Clipboard does not contain text for ClipAppend.
  11311.        3036 Clipboard cannot hold that much text (>64000 bytes)
  11312.        3037 Unable to allocate memory for clipboard.  Close some applications
  11313.        3046 Internal Error 3046. Function not defined
  11314.        3047 Variable name over 30 chars. Too Long
  11315.        3048 Substitution %Variable% not followed by % (Use %% for %)
  11316.        3049 No variables exist??!!
  11317.        3050 Undefined variable
  11318.        3051 Undefined variable or function
  11319.        3052 Uninitialized variable or undefined function
  11320.        3053 Character string too long (>256 chars??)
  11321.        3054 Unrecognizable item found on line
  11322.        3055 Variable name is over 30 chars. Too Long
  11323.        3056 Variable could not be converted to string
  11324.        3057 Variable could not be converted to integer
  11325.        3059 Illegal Bounds for StrSub function
  11326.        3061 Illegal Syntax
  11327.        3062 Attempt to divide by zero
  11328.        3063 Internal Error 3063. Binary op not found
  11329.        3064 Internal Error 3064. Unary op not found
  11330.        3065 Unbalanced Parenthesis
  11331.        3066 Wrong Number of Arguments in Function
  11332.        3067 Function Syntax. Opening parenthesis missing.
  11333.        3068 Function Syntax. Illegal delimiter found.
  11334.        3069 Illegal assignment statement. (Use == for equality testing)
  11335.        3070 Internal error 3070.  Too many arguments defined.
  11336.        3071 Missing or incomplete statement
  11337.        3072 THEN not found in IF statement
  11338.        3073 Goto Label not specified
  11339.        3074 Expression continues past expected end.
  11340.        3075 Call: Parse of file/parameter line failed
  11341.        3076 FileOpen: READ or WRITE not properly specified
  11342.        3078 FileOpen: Too many (>5) files open
  11343.        3079 FileClose: Invalid file handle
  11344.        3080 FileClose: File not currently open
  11345.        3081 FileRead: Invalid file handle
  11346.        3082 FileRead: File not currently open
  11347.        3084 FileWrite: Invalid file handle
  11348.        3085 FileWrite: File not currently open
  11349.        3087 FileRead:  File not open for reading
  11350.        3088 FileRead: Attempt to read past end of file
  11351.        3089 FileWrite: File not open for writing
  11352.        3090 Dialog Box: File open error
  11353.        3091 Dialog Box: Box too large
  11354.        3092 Dialog Box: Non-text control used w/filebox.
  11355.        3094 Dialog Box: Window Registration Failed
  11356.        3095 Compare could not be resolved into a integer or string compare
  11357.        3096 Memory allocation failure.  Out of memory for string storage
  11358.  
  11359.  
  11360.  
  11361.  
  11362.  
  11363.        3097 Memory allocation failure.  Out of memory for variable storage
  11364.        3098 Internal error, NULL pointer passed to xstrxxx subroutines
  11365.        3099 CallExt function disabled.  Not currently available.
  11366.        3101 Substituted line too long. (> 256 characters)
  11367.        3102 Drop: Can only drop variables
  11368.        3103 IsDefined: Attempting to test non-variables item
  11369.        3104 Dialog Box: Window Creation Failed
  11370.        3105 Batch Compiler:  CALL and CALLEXT not supported in compiled EXE
  11371.             versions
  11372.        3107 Run: Filetype is not COM, EXE, PIF or BAT
  11373.        3108 FileItemize: Unable to lock file info segment
  11374.        3109 FileItemize: Unable to unlock file info segment
  11375.        3110 FileItemize: Unable to lock file index segment
  11376.        3111 FileItemize: Unable to unlock file index segment
  11377.        3113 FileSize: Filelength I/O Error
  11378.        3114 FileSize: Buffer Overrun Error
  11379.        3115 FileDelete: Buffer Overrun Error
  11380.        3116 FileRename: Buffer Overrun Error
  11381.        3117 FileCopyMove: Buffer Overrun Error
  11382.  
  11383.  
  11384.  
  11385.  
  11386.  
  11387.  
  11388.                                      APPENDIX A
  11389.  
  11390.                                        Browser
  11391.  
  11392.        The Command Post Browser program lets you view a file's contents in a
  11393.        variety of ways.
  11394.  
  11395.        The default is to show the file in Windows' "ANSI text" mode:
  11396.  
  11397.  
  11398.  
  11399.  
  11400.  
  11401.  
  11402.        Initial Browser View - ANSI Text
  11403.  
  11404.        As you can see, Browser gives you five main menus to choose from:
  11405.  
  11406.  
  11407.        File
  11408.        These menu items let you open a new file to view, re-read the current
  11409.        file, and perform other housekeeping functions including exiting the
  11410.        program.
  11411.  
  11412.  
  11413.        Hide & Seek
  11414.        Browser gives you the ability to filter which lines you view with its
  11415.        Hide & Seek commands.  You can hide or show specific lines by entering
  11416.        a word to look for.
  11417.  
  11418.        For instance, the menu item Hide & Seek/Show if... displays this
  11419.        dialog box:
  11420.  
  11421.  
  11422.  
  11423.  
  11424.  
  11425.  
  11426.        ...and (in this example) shows only the lines containing the word
  11427.        "modem":
  11428.  
  11429.  
  11430.  
  11431.  
  11432.  
  11433.  
  11434.  
  11435.        Print
  11436.        These selections allow you to print all or part of the file.
  11437.  
  11438.  
  11439.        Clip Copy
  11440.        Lets you copy portions of the file into the Windows Clipboard.
  11441.  
  11442.  
  11443.        Clip Append
  11444.        Lets you add portions of the file onto the end of the Windows
  11445.        Clipboard.
  11446.  
  11447.  
  11448.        Options
  11449.        These menu items let you change how you view the file; changing for
  11450.        example between ASCII text mode (which interprets some special
  11451.        characters differently than ANSI text) and hex-dump formats:
  11452.  
  11453.  
  11454.  
  11455.  
  11456.  
  11457.  
  11458.                  Options/ASCII text                 Options/Hex dump
  11459.  
  11460.